%!PS-Adobe-2.0
%%Creator: dvips(k) 5.92b Copyright 2002 Radical Eye Software
%%Title: manual.dvi
%%Pages: 117
%%PageOrder: Ascend
%%BoundingBox: 0 0 596 842
%%DocumentFonts: Palatino-Roman Palatino-Italic Palatino-Bold Courier
%%+ CMR8 CMSY10 CMSY8 CMR10 CMMI10 Courier-Bold CMMI8 CMR7
%%EndComments
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips manual
%DVIPSParameters: dpi=1200, compressed
%DVIPSSource:  TeX output 2004.12.03:2033
%%BeginProcSet: texc.pro
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72
mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0
0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{
landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize
mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[
matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round
exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{
statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0]
N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin
/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array
/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2
array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N
df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A
definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get
}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub}
B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr
1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3
1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx
0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx
sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{
rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp
gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B
/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{
/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{
A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy
get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse}
ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp
fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17
{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add
chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{
1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop}
forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn
/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put
}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{
bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A
mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{
SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{
userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X
1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4
index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N
/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{
/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT)
(LaserWriter 16/600)]{A length product length le{A length product exch 0
exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse
end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask
grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot}
imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round
exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto
fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p
delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M}
B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{
p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S
rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end

%%EndProcSet
%%BeginProcSet: 8r.enc
% File  8r.enc as of 2002-03-12 for PSNFSS 9
%
% This is the encoding vector for Type1 and TrueType fonts to be used
% with TeX.  This file is part of the PSNFSS bundle, version 9
% 
% Authors: S. Rahtz, P. MacKay, Alan Jeffrey, B. Horn, K. Berry, W. Schmidt
%
% Idea is to have all the characters normally included in Type 1 fonts
% available for typesetting. This is effectively the characters in Adobe
% Standard Encoding + ISO Latin 1 + extra characters from Lucida + Euro.
% 
% Character code assignments were made as follows:
% 
% (1) the Windows ANSI characters are almost all in their Windows ANSI
% positions, because some Windows users cannot easily reencode the
% fonts, and it makes no difference on other systems. The only Windows
% ANSI characters not available are those that make no sense for
% typesetting -- rubout (127 decimal), nobreakspace (160), softhyphen
% (173). quotesingle and grave are moved just because it's such an
% irritation not having them in TeX positions.
% 
% (2) Remaining characters are assigned arbitrarily to the lower part
% of the range, avoiding 0, 10 and 13 in case we meet dumb software.
% 
% (3) Y&Y Lucida Bright includes some extra text characters; in the
% hopes that other PostScript fonts, perhaps created for public
% consumption, will include them, they are included starting at 0x12.
% 
% (4) Remaining positions left undefined are for use in (hopefully)
% upward-compatible revisions, if someday more characters are generally
% available.
% 
% (5) hyphen appears twice for compatibility with both ASCII and Windows.
%
% (6) /Euro is assigned to 128, as in Windows ANSI
% 
/TeXBase1Encoding [
% 0x00 (encoded characters from Adobe Standard not in Windows 3.1)
  /.notdef /dotaccent /fi /fl
  /fraction /hungarumlaut /Lslash /lslash
  /ogonek /ring /.notdef
  /breve /minus /.notdef 
% These are the only two remaining unencoded characters, so may as
% well include them.
  /Zcaron /zcaron 
% 0x10
 /caron /dotlessi 
% (unusual TeX characters available in, e.g., Lucida Bright)
 /dotlessj /ff /ffi /ffl 
 /.notdef /.notdef /.notdef /.notdef
 /.notdef /.notdef /.notdef /.notdef
 % very contentious; it's so painful not having quoteleft and quoteright
 % at 96 and 145 that we move the things normally found there down to here.
 /grave /quotesingle 
% 0x20 (ASCII begins)
 /space /exclam /quotedbl /numbersign
 /dollar /percent /ampersand /quoteright
 /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash
% 0x30
 /zero /one /two /three /four /five /six /seven
 /eight /nine /colon /semicolon /less /equal /greater /question
% 0x40
 /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O
% 0x50
 /P /Q /R /S /T /U /V /W
 /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
% 0x60
 /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o
% 0x70
 /p /q /r /s /t /u /v /w
 /x /y /z /braceleft /bar /braceright /asciitilde
 /.notdef % rubout; ASCII ends
% 0x80
 /Euro /.notdef /quotesinglbase /florin
 /quotedblbase /ellipsis /dagger /daggerdbl
 /circumflex /perthousand /Scaron /guilsinglleft
 /OE /.notdef /.notdef /.notdef
% 0x90
 /.notdef /.notdef /.notdef /quotedblleft
 /quotedblright /bullet /endash /emdash
 /tilde /trademark /scaron /guilsinglright
 /oe /.notdef /.notdef /Ydieresis
% 0xA0
 /.notdef % nobreakspace
 /exclamdown /cent /sterling
 /currency /yen /brokenbar /section
 /dieresis /copyright /ordfeminine /guillemotleft
 /logicalnot
 /hyphen % Y&Y (also at 45); Windows' softhyphen
 /registered
 /macron
% 0xD0
 /degree /plusminus /twosuperior /threesuperior
 /acute /mu /paragraph /periodcentered
 /cedilla /onesuperior /ordmasculine /guillemotright
 /onequarter /onehalf /threequarters /questiondown
% 0xC0
 /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
 /Egrave /Eacute /Ecircumflex /Edieresis
 /Igrave /Iacute /Icircumflex /Idieresis
% 0xD0
 /Eth /Ntilde /Ograve /Oacute
 /Ocircumflex /Otilde /Odieresis /multiply
 /Oslash /Ugrave /Uacute /Ucircumflex
 /Udieresis /Yacute /Thorn /germandbls
% 0xE0
 /agrave /aacute /acircumflex /atilde
 /adieresis /aring /ae /ccedilla
 /egrave /eacute /ecircumflex /edieresis
 /igrave /iacute /icircumflex /idieresis
% 0xF0
 /eth /ntilde /ograve /oacute
 /ocircumflex /otilde /odieresis /divide
 /oslash /ugrave /uacute /ucircumflex
 /udieresis /yacute /thorn /ydieresis
] def

%%EndProcSet
%%BeginProcSet: f7b6d320.enc
% Thomas Esser, Dec 2002. public domain
%
% Encoding for:
%     cmb10 cmbx10 cmbx12 cmbx5 cmbx6 cmbx7 cmbx8 cmbx9 cmbxsl10
%     cmdunh10 cmr10 cmr12 cmr17cmr6 cmr7 cmr8 cmr9 cmsl10 cmsl12 cmsl8
%     cmsl9 cmss10cmss12 cmss17 cmss8 cmss9 cmssbx10 cmssdc10 cmssi10
%     cmssi12 cmssi17 cmssi8cmssi9 cmssq8 cmssqi8 cmvtt10
%
/TeXf7b6d320Encoding [
/Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /Omega
/ff /fi /fl /ffi /ffl /dotlessi /dotlessj /grave /acute /caron /breve
/macron /ring /cedilla /germandbls /ae /oe /oslash /AE /OE /Oslash
/suppress /exclam /quotedblright /numbersign /dollar /percent /ampersand
/quoteright /parenleft /parenright /asterisk /plus /comma /hyphen
/period /slash /zero /one /two /three /four /five /six /seven /eight
/nine /colon /semicolon /exclamdown /equal /questiondown /question /at
/A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X
/Y /Z /bracketleft /quotedblleft /bracketright /circumflex /dotaccent
/quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u
/v /w /x /y /z /endash /emdash /hungarumlaut /tilde /dieresis /suppress
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space
/Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /.notdef
/.notdef /Omega /ff /fi /fl /ffi /ffl /dotlessi /dotlessj /grave /acute
/caron /breve /macron /ring /cedilla /germandbls /ae /oe /oslash /AE
/OE /Oslash /suppress /dieresis /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
] def

%%EndProcSet
%%BeginProcSet: bbad153f.enc
% Thomas Esser, Dec 2002. public domain
%
% Encoding for:
%     cmsy10 cmsy5 cmsy6 cmsy7 cmsy8 cmsy9
%
/TeXbbad153fEncoding [
/minus /periodcentered /multiply /asteriskmath /divide /diamondmath
/plusminus /minusplus /circleplus /circleminus /circlemultiply
/circledivide /circledot /circlecopyrt /openbullet /bullet
/equivasymptotic /equivalence /reflexsubset /reflexsuperset /lessequal
/greaterequal /precedesequal /followsequal /similar /approxequal
/propersubset /propersuperset /lessmuch /greatermuch /precedes /follows
/arrowleft /arrowright /arrowup /arrowdown /arrowboth /arrownortheast
/arrowsoutheast /similarequal /arrowdblleft /arrowdblright /arrowdblup
/arrowdbldown /arrowdblboth /arrownorthwest /arrowsouthwest /proportional
/prime /infinity /element /owner /triangle /triangleinv /negationslash
/mapsto /universal /existential /logicalnot /emptyset /Rfractur /Ifractur
/latticetop /perpendicular /aleph /A /B /C /D /E /F /G /H /I /J /K
/L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /union /intersection
/unionmulti /logicaland /logicalor /turnstileleft /turnstileright
/floorleft /floorright /ceilingleft /ceilingright /braceleft /braceright
/angbracketleft /angbracketright /bar /bardbl /arrowbothv /arrowdblbothv
/backslash /wreathproduct /radical /coproduct /nabla /integral
/unionsq /intersectionsq /subsetsqequal /supersetsqequal /section
/dagger /daggerdbl /paragraph /club /diamond /heart /spade /arrowleft
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/minus /periodcentered /multiply /asteriskmath /divide /diamondmath
/plusminus /minusplus /circleplus /circleminus /.notdef /.notdef
/circlemultiply /circledivide /circledot /circlecopyrt /openbullet
/bullet /equivasymptotic /equivalence /reflexsubset /reflexsuperset
/lessequal /greaterequal /precedesequal /followsequal /similar
/approxequal /propersubset /propersuperset /lessmuch /greatermuch
/precedes /follows /arrowleft /spade /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
] def

%%EndProcSet
%%BeginProcSet: aae443f0.enc
% Thomas Esser, Dec 2002. public domain
%
% Encoding for:
%     cmmi10 cmmi12 cmmi5 cmmi6 cmmi7 cmmi8 cmmi9 cmmib10
%
/TeXaae443f0Encoding [
/Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /Omega
/alpha /beta /gamma /delta /epsilon1 /zeta /eta /theta /iota /kappa
/lambda /mu /nu /xi /pi /rho /sigma /tau /upsilon /phi /chi /psi
/omega /epsilon /theta1 /pi1 /rho1 /sigma1 /phi1 /arrowlefttophalf
/arrowleftbothalf /arrowrighttophalf /arrowrightbothalf /arrowhookleft
/arrowhookright /triangleright /triangleleft /zerooldstyle /oneoldstyle
/twooldstyle /threeoldstyle /fouroldstyle /fiveoldstyle /sixoldstyle
/sevenoldstyle /eightoldstyle /nineoldstyle /period /comma /less /slash
/greater /star /partialdiff /A /B /C /D /E /F /G /H /I /J /K /L /M /N
/O /P /Q /R /S /T /U /V /W /X /Y /Z /flat /natural /sharp /slurbelow
/slurabove /lscript /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p
/q /r /s /t /u /v /w /x /y /z /dotlessi /dotlessj /weierstrass /vector
/tie /psi /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/space /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi
/.notdef /.notdef /Omega /alpha /beta /gamma /delta /epsilon1 /zeta /eta
/theta /iota /kappa /lambda /mu /nu /xi /pi /rho /sigma /tau /upsilon
/phi /chi /psi /tie /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef
] def

%%EndProcSet
%%BeginProcSet: texps.pro
%!
TeXDict begin/rf{findfont dup length 1 add dict begin{1 index/FID ne 2
index/UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll
exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]FontType 0
ne{/Metrics exch def dict begin Encoding{exch dup type/integertype ne{
pop pop 1 sub dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get
div def}ifelse}forall Metrics/Metrics currentdict end def}{{1 index type
/nametype eq{exit}if exch pop}loop}ifelse[2 index currentdict end
definefont 3 -1 roll makefont/setfont cvx]cvx def}def/ObliqueSlant{dup
sin S cos div neg}B/SlantFont{4 index mul add}def/ExtendFont{3 -1 roll
mul exch}def/ReEncodeFont{CharStrings rcheck{/Encoding false def dup[
exch{dup CharStrings exch known not{pop/.notdef/Encoding true def}if}
forall Encoding{]exch pop}{cleartomark}ifelse}if/Encoding exch def}def
end

%%EndProcSet
%%BeginFont: CMR7
%!PS-AdobeFont-1.1: CMR7 1.0
%%CreationDate: 1991 Aug 20 16:39:21
% Copyright (C) 1997 American Mathematical Society. All Rights Reserved.
11 dict begin
/FontInfo 7 dict dup begin
/version (1.0) readonly def
/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def
/FullName (CMR7) readonly def
/FamilyName (Computer Modern) readonly def
/Weight (Medium) readonly def
/ItalicAngle 0 def
/isFixedPitch false def
end readonly def
/FontName /CMR7 def
/PaintType 0 def
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0] readonly def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
dup 0 /.notdef put
readonly def
/FontBBox{-27 -250 1122 750}readonly def
/UniqueID 5000790 def
currentdict end
currentfile eexec
D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891
016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171
9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F
D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758
469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8
2BDBF16FBC7512FAA308A093FE5CF5B8CABB9FFC6CC3F1E9AE32F234EB60FE7D
E34995B1ACFF52428EA20C8ED4FD73E3935CEBD40E0EAD70C0887A451E1B1AC8
47AEDE4191CCDB8B61345FD070FD30C4F375D8418DDD454729A251B3F61DAE7C
8882384282FDD6102AE8EEFEDE6447576AFA181F27A48216A9CAD730561469E4
78B286F22328F2AE84EF183DE4119C402771A249AAC1FA5435690A28D1B47486
1060C8000D3FE1BF45133CF847A24B4F8464A63CEA01EC84AA22FD005E74847E
01426B6890951A7DD1F50A5F3285E1F958F11FC7F00EE26FEE7C63998EA1328B
C9841C57C80946D2C2FC81346249A664ECFB08A2CE075036CEA7359FCA1E90C0
F686C3BB27EEFA45D548F7BD074CE60E626A4F83C69FE93A5324133A78362F30
8E8DCC80DD0C49E137CDC9AC08BAE39282E26A7A4D8C159B95F227BDA2A281AF
A9DAEBF31F504380B20812A211CF9FEB112EC29A3FB3BD3E81809FC6293487A7
455EB3B879D2B4BD46942BB1243896264722CB59146C3F65BD59B96A74B12BB2
9A1354AF174932210C6E19FE584B1B14C00E746089CBB17E68845D7B3EA05105
EEE461E3697FCF835CBE6D46C75523478E766832751CF6D96EC338BDAD57D53B
52F5340FAC9FE0456AD13101824234B262AC0CABA43B62EBDA39795BAE6CFE97
563A50AAE1F195888739F2676086A9811E5C9A4A7E0BF34F3E25568930ADF80F
0BDDAC3B634AD4BA6A59720EA4749236CF0F79ABA4716C340F98517F6F06D9AB
7ED8F46FC1868B5F3D3678DF71AA772CF1F7DD222C6BF19D8EF0CFB7A76FC6D1
0AD323C176134907AB375F20CFCD667AB094E2C7CB2179C4283329C9E435E7A4
1E042AD0BAA059B3F862236180B34D3FCED833472577BACD472A4B067A46F8EE
2AFACDE591ADF7304939394F37018327C1B4E53C8D6C39E9B246C2D5FC828A32
73B84253139F2C6B481F04AF58F214F040517073839F9755E4CD617458F69780
588263E8AE4F31263902D7D3FD4678C62FD46B635D3C58A7889BAE8B1A90BC93
3F40E07284B2810F1341749474A7B6739A81D32D10896D255229BA209327549E
94EECC4118BC2FCAF2EF08F609197A8BAEC51CCD340D5F0620A3CB41964D487D
DDFD0E60882A5D836480F5C04F1911A3DCE205724503F9F2C1C682DDB75E0D93
583387BA5A73FBC7D5D1CB54A63CA5EEF72DAB92D71E04F1D1031290976C570C
AC1FFB336E0A87CE1654CC92C45E080A4119002172D426E1F39BA3E99B9A0E18
27FE4AD80A35AA2AAF0D103562DEAF06CB14131D2164378DB0B4784889675DFE
B4168C4428FEE73ED8D59C224ED43D5438EA5D17E421EBA1BEEC329137DC7E1B
4478460DC1E9501A510BE07442FC0DBA4B9040C959CE033DEC458C3D8ED49E5A
7DEFF3C14F0A953BA55DC6F7DF00E864B9508F98CE53A60076D2D61202D67406
B2375AF1954CC3240965C98B1D4368F9B4CCCAA8585130458D424CB0DB7CF2AE
DE1B38C3D6C6817BD1A214E41728749368DC45E052F2B73A36BF9FA639BD40AE
6DE0F9FE14C7FFAF2774C371C33631D724578C73C997A9E5B7BC796AF5208736
90B0A8B2DC1E8A9BED9B67328F45B25D9003518EB7148C1D842413A4CC4CD09F
93DAE64D7E32AE1450660397CBCE196B98E89E0F7829A2C5430990EFC8A263F3
9932AC812EDE813303AE6A7C9A3BB14EE47E6E88632D7461C7EE5FCC874E3D7C
0B7BADADEC490ADFD4277C0CB478B53F3BF5AD
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
cleartomark
%%EndFont 
%%BeginFont: CMMI8
%!PS-AdobeFont-1.1: CMMI8 1.100
%%CreationDate: 1996 Jul 23 07:53:54
% Copyright (C) 1997 American Mathematical Society. All Rights Reserved.
11 dict begin
/FontInfo 7 dict dup begin
/version (1.100) readonly def
/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def
/FullName (CMMI8) readonly def
/FamilyName (Computer Modern) readonly def
/Weight (Medium) readonly def
/ItalicAngle -14.04 def
/isFixedPitch false def
end readonly def
/FontName /CMMI8 def
/PaintType 0 def
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0] readonly def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
dup 0 /.notdef put
readonly def
/FontBBox{-24 -250 1110 750}readonly def
/UniqueID 5087383 def
currentdict end
currentfile eexec
D9D66F633B846A97B686A97E45A3D0AA0529731C99A784CCBE85B4993B2EEBDE
3B12D472B7CF54651EF21185116A69AB1096ED4BAD2F646635E019B6417CC77B
532F85D811C70D1429A19A5307EF63EB5C5E02C89FC6C20F6D9D89E7D91FE470
B72BEFDA23F5DF76BE05AF4CE93137A219ED8A04A9D7D6FDF37E6B7FCDE0D90B
986423E5960A5D9FBB4C956556E8DF90CBFAEC476FA36FD9A5C8175C9AF513FE
D919C2DDD26BDC0D99398B9F4D03D6A8F05B47AF95EF28A9C561DBDC98C47CF5
5250011D19E9366EB6FD153D3A100CAA6212E3D5D93990737F8D326D347B7EDC
4391C9DF440285B8FC159D0E98D4258FC57892DDF753642CD526A96ACEDA4120
788F22B1D09F149794E66DD1AC2C2B3BC6FEC59D626F427CD5AE9C54C7F78F62
C36F49B3C2E5E62AFB56DCEE87445A12A942C14AE618D1FE1B11A9CF9FAA1F32
617B598CE5058715EF3051E228F72F651040AD99A741F247C68007E68C84E9D1
D0BF99AA5D777D88A7D3CED2EA67F4AE61E8BC0495E7DA382E82DDB2B009DD63
532C74E3BE5EC555A014BCBB6AB31B8286D7712E0E926F8696830672B8214E9B
5D0740C16ADF0AFD47C4938F373575C6CA91E46D88DE24E682DEC44B57EA8AF8
4E57D45646073250D82C4B50CBBB0B369932618301F3D4186277103B53B3C9E6
DB42D6B30115F67B9D078220D5752644930643BDF9FACF684EBE13E39B65055E
B1BD054C324962025EC79E1D155936FE32D9F2224353F2A46C3558EF216F6BB2
A304BAF752BEEC36C4440B556AEFECF454BA7CBBA7537BCB10EBC21047333A89
8936419D857CD9F59EBA20B0A3D9BA4A0D3395336B4CDA4BA6451B6E4D1370FA
D9BDABB7F271BC1C6C48D9DF1E5A6FAE788F5609DE3C48D47A67097C547D9817
AD3A7CCE2B771843D69F860DA4059A71494281C0AD8D4BAB3F67BB6739723C04
AE05F9E35B2B2CB9C7874C114F57A185C8563C0DCCA93F8096384D71A2994748
A3C7C8B8AF54961A8838AD279441D9A5EB6C1FE26C98BD025F353124DA68A827
AE2AF8D25CA48031C242AA433EEEBB8ABA4B96821786C38BACB5F58C3D5DA011
85B385124DFAE11BA4AB27032F02AB84277DB8B54826CB75B5ECF9878D64D0D2
5AC4506D5C656629EACE8AE5685D415E22C59E84B89527286786C675B1AFA454
2837A67268F06EF698B0294A84F007116B2822424AE0CDC8F3D495E64302BAA4
E4C20BA2356BA1DF864C793A55D32F4310DFB4F23DE921399D432EECD8D03F52
ABFA21F4EBA4C418139A32C220A65D626D98A34BDAABDB371E848A7CD912531C
D29DA90A905E4FAE9F504CC5B2A5EABD0E35F5B21D9FAF1366996091CA53E206
5728501386D3E0F7FFF4F43F1DB0FB3A72E51B920608C6167756F098DE6EE04B
CC9697DC6F999B2CA4A7FA934CBC03FD200FF4D8D22635F254EC09E460EC0526
5029482FBD526753CBDF8F0768DF986359B433FF810C57BFB8407DB80E6EBD64
904D3660CD46E96162A1E64B21DEFEFD0E09C8FAFFFB82467C1DF41BA078171F
9F24E6CAEE32FC0CF25A5D8409B1E6541EF667E6B4E05D8D6289E5E7B8532013
6EC8C91D6DA1AA512D806CA8F21153F07C880212C3B5B38A2297CA4E33C2B61E
C1A092945DB7391335455D783DD84D23DB4218F1233CE690759514E9939C3D45
C1E78123BAB987AA59FB83A9604B4031CC0FB047BB7A240D1B87C886CB8AAB27
5CF6F37DC9B5E5304144E406CC68B5D4F09A31C788C25D2ACAF85324BFF39451
FD72EC05EDF48BB887A6B467F030564C7E9C68C5376DE6FEFDBE9EE60B672372
BABB3E598FFDE699DEE9E5997E0FFC320DEB415DB90AE2AF2E598B569CE58E20
2ECF99BB0DDF4D3E5C6764074EC3A3CCC143DDE9A23370BCEBD689DF8C71EA62
FC6A73E3F75B4D4CEB8EA14EA7AF87E23F
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
cleartomark
%%EndFont 
%%BeginFont: CMMI10
%!PS-AdobeFont-1.1: CMMI10 1.100
%%CreationDate: 1996 Jul 23 07:53:57
% Copyright (C) 1997 American Mathematical Society. All Rights Reserved.
11 dict begin
/FontInfo 7 dict dup begin
/version (1.100) readonly def
/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def
/FullName (CMMI10) readonly def
/FamilyName (Computer Modern) readonly def
/Weight (Medium) readonly def
/ItalicAngle -14.04 def
/isFixedPitch false def
end readonly def
/FontName /CMMI10 def
/PaintType 0 def
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0] readonly def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
dup 0 /.notdef put
readonly def
/FontBBox{-32 -250 1048 750}readonly def
/UniqueID 5087385 def
currentdict end
currentfile eexec
D9D66F633B846A97B686A97E45A3D0AA0529731C99A784CCBE85B4993B2EEBDE
3B12D472B7CF54651EF21185116A69AB1096ED4BAD2F646635E019B6417CC77B
532F85D811C70D1429A19A5307EF63EB5C5E02C89FC6C20F6D9D89E7D91FE470
B72BEFDA23F5DF76BE05AF4CE93137A219ED8A04A9D7D6FDF37E6B7FCDE0D90B
986423E5960A5D9FBB4C956556E8DF90CBFAEC476FA36FD9A5C8175C9AF513FE
D919C2DDD26BDC0D99398B9F4D03D5993DFC0930297866E1CD0A319B6B1FD958
9E394A533A081C36D456A09920001A3D2199583EB9B84B4DEE08E3D12939E321
990CD249827D9648574955F61BAAA11263A91B6C3D47A5190165B0C25ABF6D3E
6EC187E4B05182126BB0D0323D943170B795255260F9FD25F2248D04F45DFBFB
DEF7FF8B19BFEF637B210018AE02572B389B3F76282BEB29CC301905D388C721
59616893E774413F48DE0B408BC66DCE3FE17CB9F84D205839D58014D6A88823
D9320AE93AF96D97A02C4D5A2BB2B8C7925C4578003959C46E3CE1A2F0EAC4BF
8B9B325E46435BDE60BC54D72BC8ACB5C0A34413AC87045DC7B84646A324B808
6FD8E34217213E131C3B1510415CE45420688ED9C1D27890EC68BD7C1235FAF9
1DAB3A369DD2FC3BE5CF9655C7B7EDA7361D7E05E5831B6B8E2EEC542A7B38EE
03BE4BAC6079D038ACB3C7C916279764547C2D51976BABA94BA9866D79F13909
95AA39B0F03103A07CBDF441B8C5669F729020AF284B7FF52A29C6255FCAACF1
74109050FBA2602E72593FBCBFC26E726EE4AEF97B7632BC4F5F353B5C67FED2
3EA752A4A57B8F7FEFF1D7341D895F0A3A0BE1D8E3391970457A967EFF84F6D8
47750B1145B8CC5BD96EE7AA99DDC9E06939E383BDA41175233D58AD263EBF19
AFC0E2F840512D321166547B306C592B8A01E1FA2564B9A26DAC14256414E4C8
42616728D918C74D13C349F4186EC7B9708B86467425A6FDB3A396562F7EE4D8
40B43621744CF8A23A6E532649B66C2A0002DD04F8F39618E4F572819DD34837
B5A08E643FDCA1505AF6A1FA3DDFD1FA758013CAED8ACDDBBB334D664DFF5B53
956017667589EE6908966A17DDDE40C2FA52A4C9DA871EA5FB0DDA525B33B515
65B5BE7DA7928173124C964868BD65AD18BA9470C0D0A9940DE025C42EFC685D
FEA54F355AE54EAD5399C2F7BE8A83CF85918EC3CE8C50209C729629B23F2025
38CB37D6F4CAEAD195F9543F34D6EB421DFB4369ECE59F62FF86B3B2A8052087
2DEB60E164B25C13AB45F7116E2DA64AE7B47F202D352F9DEA59F12BF86B3929
1D5EBD180D557C169C1248021CCB50C113890D91D61EE3D3C4C23CBB794D97DE
2509773A8EAFAA54BA93C30F3B9D6A9AA42A0811C695EAFC8D96966457B72820
F3608CF747A9F991F580FDB00A1FFD7927900B6C94F689F85DAA41A2B8F1985F
17CAF32B312AC4FE522E1352074EB95773706682523CCE8A9DDA3D00D2E4123F
C32738762EBD5D05004FFF4D307DA74126586F669577EA50E20792645C702B49
B08BEEA8DE960B8E314D8988F9A0578361C98133BACD0F2CB715C7B2AAB94815
EBCA72BFBC2E7BFF85BD36C86D35887C92DEB017064FB9EA79C661F8D378519C
27DB2E748F5BA6BB5ABD9DF7492613747A0500A8ED40D163FAE053CA090D5392
D95BB1B13EFB2A6E89A13A7EBDEF9A39F6753E2D5BCB11AAC55E8B358750AECE
822DD8897967FFB564E997B6F7CDA4AD6E956C31ACB57618D981D1D1B8436E93
9104181177B7D8F68D19BD9A9F1DAF040B3F5EA43BBC6626B42E18674E7B351C
C296BD3DB9D54FA2ED16E679B8D696A020B2FD1F0F9EDB3FBC1A0630D0EDBFFA
0FC442D7BFC1636DABF28A54C5ECCDBE1BE09EBFAA26001246991944E8203575
4A0B91704BD84ADDD7F169E7CD098DC32D84EC14B210ABC84B1952A6C167A5B2
E1190893073D5DD374A587A5199CBB9F05289FC91100625544BAF29E6E3419A3
AE3E4802EF9B669F559F407546C1FEADEF57D12981553A6EED285F6037E4439B
2C7E25AF613CE232B083E51C6331ED4CF1C6FA65A53776B248BD43B804D9530F
5590584A5F68155D313CD8F6D0C8731EE5004F0F65320D78DD81557E082B02D1
1A0C0FC1B8D057483BC815314A4514941B53C69420399354F11DB32C667CBDFB
AF75A019D66A37911F4CC70511FF508B2F9F7E335ED669B614B853E85F73C251
DD4B15E1D289B2CA199C41722A3CFEEBE1AF8B4869566269C818648E3787416F
7C2D9E4D6A58ED08C7DB6510549CD995F9BFA2D57BFE566D7BA03D7E8739A702
D1B1FFE1AF8C7EAD35B64A0F8976703183FA6F5987EAC6EDB8A959D5E9923B15
081E99C74ABF276B5CFBDF5FD1726D865AA4A16B492E3A28045D3E2A317DAC68
E63C4E4744DFA5E2E690DE5885A3DF720242B596E9D53FD345B64578477B9F52
10997F73BC4851A9ACC9F21C939C9604287316DD38B2BD9ED2D4736F90064831
50BE8E1E6E81374B1D85B7D46FEFB00EF326784ACE201F95F3DC390016D01587
4C531340CFD35D7891264602A8377E2817E598B36CECDC181DEA955430ACCB33
BA96DD2D0FAA7264C9B157704540C9A4CA8536421C546BE2B6E0A855348E0A4F
85A8BF545693FC2AAF0786C068941D900965B138A986931A29D2FA6602CBA298
9441AF2BE90E5CE797FB77747158B06B2D15C02528D54E9655FE92456F6BEA2B
9EDCA48EE47FB08DA6997AE00FCF26A1AA29F5AD2252B732AFF543A073201D21
909BA5438F248E1B0E3B1320E818747C6291AC5B2CDC6EF58664AB9421008619
C7F1433D6DB7013E5DF00857EBE49F4336D0D95C504342BD85EC56C78E3EBF82
E441E9E85C25E661F6398B6063C696D04ACD983330EAC521611576E32862422D
9456B140EC2AFA1E833E7781933DB7327407FB7F9CBAFEA38DC9BE04989860B0
96BFA2C091CCFC53892FA200AE697ADF1403DC5D969D5A86E305428B4E8A8414
B8427FAAC8048E5272CDF3A7F3685E01BFD8F31FC4E2EB79E4BF0CB1366A677F
1EFE975A4340AD264F8C006769BD2FBE3E39A55697A3ECFDC3A663B1BC1CF5DC
3B7CD8AB09BABD45F5DEE3746CE32740C579C4E5B28902B14BF5C86E211863FD
6B519B4D6D1D35F8AA79F05A14C8FD4CF67D43A9229227A17C245250AE6C989E
35F536A773A16CAF4215AAF1E9CC9404E475ECF446E96A385C397E778302BEF4
C70FD52295C52B193C0C51342E0EFF3014D3C5748174DA534705BB7FF831915E
706450802F1D58E508978B33D573F23CED790D04BBD6BEB88851CD6E54A10A2E
ED646339D9B28D8762B30AFD2BE63FE60C81704671F5BDEC536686423C330B4F
4507E10CD8882F74117BBDC42AF801F6B96A98FE5F7486C37D36BE651CB9DFF9
210CBF1179B5C3C80FD182BB9C6A9E236F0519918AF8699DBD29D5D017AC93BD
8678D778259B93D86A0F80968520D73525D98FC39D75B2F542814863FDA831E9
C5B735C9B290D6CDF67BB5C25AB895F9A16C5A51A144DEDB9691D3EB46B1D431
61EE609215F50AFF6D3D7B07EF2C05E8E7A3DEDBC4247B6BD9CCFD203BAD3F34
9261478DB1EAC77A7088FD3BF1A58DB88562FB0DFD5031FD7C418AB31E32DFD0
9E6CFEDAE5871520DBDCEBF8C3BFBC5E430E3D4F5EF9B52EA908AD09137DBDDE
80D3EB692CC36107B1C9C9AC6AA7D92698E95DBF0E18F1D9755E4B19CAF66751
E7D8D277EAA464BBA215A70594AAD46BD8B3AB6BC03C7A8CA3FE2D125A475F8D
76BF2C8E6F0F06FB7959AB5E5010E47FC61D33ABBBB2A3AB975FEF08B623013F
22F8807A64554001045D66593F82A9A2D891B6DE539A4E0253E81D09B6A3C818
16CDC524475760B3B78160B2DD2B8F825EC79552CC75C36BAF4A6777497CEF80
6DAFB4C424FC409FFBAA3D0D3EB50727287AB6F52A31C3A644DA4F2194641010
A7D4CF99ED0C83C05B5D054FF7E220F593CB17600C33A07C4077A7EDCCCF6665
9A17ADB2D6EDBF0EA00BEDB7E510A67549465D9894ADBD7FCEFE42B8C787BDED
BD20D5C295F571916E2DF30E14B864818D9095263052AA913F6833DB543F2896
E1DD23EC97319A99EB731A3560DC15A8F9C98E27E60BE83D8A8B438405B221C3
BA66B80683B599501510AF014D14C951297706F2704EA807FDEEA7AB0F22FE5B
92287D0E98F0C535D58474A38B044861F834E1DDAA023D77CE20FFD46CC26E33
99C438E636ABBF30F3EEE88FF0DB4846A015AB3B576DCB3E78292A88B701A947
DEE6681DDD9391445B2707969779CF65D216CE0AA8855721CC1610DD2BFF9866
F821B5DB8A421EBA237FBC41DB71A1B56034130B376089A890FFF447B8BEA562
7BC9D7F2E05269A6F20B5BE1BCC065D69674624C3C67FDF2FA60267D435B43BA
2B21A687053F74FEA82B34D5D55A0F52452F279078EFD3F7DEFD9904C00DD3BF
9B574AF3DC98EFA5E0C159A8ADE004A035FB9808F2F4E8AD26ED123F0140A372
48A28D3D40B1425657B579FD820B6F380D7C4A3147B14D4D4286063B8D73BD55
091B9D217B136489CB56E952B753C33A20131D59D8488E98FBCD77006FFACF4C
4C341503BD5D43A40AC18E41DC962302044F9A8D1AFA97A76D24468BFAFB00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
cleartomark
%%EndFont 
%%BeginFont: CMR10
%!PS-AdobeFont-1.1: CMR10 1.00B
%%CreationDate: 1992 Feb 19 19:54:52
% Copyright (C) 1997 American Mathematical Society. All Rights Reserved.
11 dict begin
/FontInfo 7 dict dup begin
/version (1.00B) readonly def
/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def
/FullName (CMR10) readonly def
/FamilyName (Computer Modern) readonly def
/Weight (Medium) readonly def
/ItalicAngle 0 def
/isFixedPitch false def
end readonly def
/FontName /CMR10 def
/PaintType 0 def
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0] readonly def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
dup 0 /.notdef put
readonly def
/FontBBox{-251 -250 1009 969}readonly def
/UniqueID 5000793 def
currentdict end
currentfile eexec
D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891
016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171
9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F
D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758
469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8
2BDBF16FBC7512FAA308A093FE5CF7158F1163BC1F3352E22A1452E73FECA8A4
87100FB1FFC4C8AF409B2067537220E605DA0852CA49839E1386AF9D7A1A455F
D1F017CE45884D76EF2CB9BC5821FD25365DDEA6E45F332B5F68A44AD8A530F0
92A36FAC8D27F9087AFEEA2096F839A2BC4B937F24E080EF7C0F9374A18D565C
295A05210DB96A23175AC59A9BD0147A310EF49C551A417E0A22703F94FF7B75
409A5D417DA6730A69E310FA6A4229FC7E4F620B0FC4C63C50E99E179EB51E4C
4BC45217722F1E8E40F1E1428E792EAFE05C5A50D38C52114DFCD24D54027CBF
2512DD116F0463DE4052A7AD53B641A27E81E481947884CE35661B49153FA19E
0A2A860C7B61558671303DE6AE06A80E4E450E17067676E6BBB42A9A24ACBC3E
B0CA7B7A3BFEA84FED39CCFB6D545BB2BCC49E5E16976407AB9D94556CD4F008
24EF579B6800B6DC3AAF840B3FC6822872368E3B4274DD06CA36AF8F6346C11B
43C772CC242F3B212C4BD7018D71A1A74C9A94ED0093A5FB6557F4E0751047AF
D72098ECA301B8AE68110F983796E581F106144951DF5B750432A230FDA3B575
5A38B5E7972AABC12306A01A99FCF8189D71B8DBF49550BAEA9CF1B97CBFC7CC
96498ECC938B1A1710B670657DE923A659DB8757147B140A48067328E7E3F9C3
7D1888B284904301450CE0BC15EEEA00E48CCD6388F3FC3BE69673F79C90307B
434AFA1C9B6E1333128BDB6332FA2FCB7879D67DF71EA7F061CBE404D9EAE9B9
0595D1372D35C0FF5C49F1385F04B9B7B8664903D7E973E74B0DBCAE290D4AB1
AA8DB8F8DE76BD237BBF9F3FA25FFA4F3241FE193633A7FBAC0213E32680D477
72F7F63D27EE5371111ACA14E65B2048632B08F94953ECED7571EA83A7E87994
79C0B57A332D8273DED975BD53607ED94253CB78FFAD6ED31AAF3BFABAFE773F
095BA4D5A0F9607E25DC31311B59B12516816675EF303FE4F01F1F84DE922D60
B9A32F971FDC88ED8244072D111FAF3B29F82B6608AAA990E81BE87FEA27BCD1
382A83DC20215D1BA029E3DC9063F4DFF450CF263B5C9CC18EFB659E748562A8
2BEA336E043FF1EB660F261482EA4A2A26440001055D27B9479396116CB75D37
35842F6E706AEF546768BA33610DA9AFCC96BB51D59C946E05361A8CEEB26CB7
4AA53AEA80D28BB5B1029160BC23DD78518B47DD0E03D0292499329D2EA83CA2
8817780A2E85A4E0740F8195CF1E01B75ABA1EB5C901DEF3E16541D2EC156142
17201237410D8284D4122ADA4925B110FFE2CE039BB11F45B52068CE5B5826A3
576D58ECCFC7E5658DA00E281EE23F44BA04A75CA357C3415525CA05E017F6EA
82A48179FEB0BFBB6DC2FA129B42E2142611ED0A8ACAC6E8EBFCB05A5A8CE0E9
79A0E6C7B14127EF7F8DD0901865EBE6D2D79E59F5B3566553602CF3D855FF25
F5E0A473BA928FF7D401437FAA45A7875DE9FBE63BEFFEC49A377254B981CAE4
83B8C9A80BADAAEC8F1602CA4E94DA19968541E940E2965DEAD4F76711CE6B9D
74B330956DBFDB57FE6275D1873E08F3DE5886EACBFF2A13350C351418EB5A89
8BA95D5857F0E6D8CA3BFA442B63BD025D257624B3EE5A864F6E65094FD7C701
372955C5608635A76845967CFBBEE7810EC93784B7C3912AC9127E70D10C3A04
EE976B8938FDA640CB30742D5D5B147C74880C06A2606E3AC1E0302E4E863FE5
0701BC3EE6FF552D09C81E23F14F6A9443B3B906E71B62B3C19A18A5324EC03E
70F6F916D06C33A25221D1214DF2D60BB86C86906C191D8014E5BE99F9AD862E
388655064FC9406C452DDD07289C6F8FC3D87E2F5BA8A0EF4C136395554FB53F
59E3EA76ACD82ED51C5AF60257F8A9C25D0B0929E74013345D179667F21FDC56
E126A4D328359012E96960133D055401A485C3AD8E1FEE029A382BF0A8F89D2B
8C5D6029A47841C5D5A3302582C3DE7F388CCE025910C09FB7092F42BDDCD0DA
58194EBDA77EA148E2BC1122AE52EAEAFA53D9B20AC8DA5A926101F01A4ECF47
B8497EC944B966A4B803C3AB92A508A6081499EA944539E10058340B3937EF9B
5BF29638EAD69953D22B8EA9748F1D224026A4178700E4D625C85034468D98AE
1797BD5CCC6D89A0F033B9D6A08688F193632B0432BC37C9843033CAA8A1474C
09ED7E55A0474B6690C10336C9CC94DE885D9039DE473C521DE14526CBA224E3
AD5D9E3949FD77579D798DB0B698C03523AB6A78934DB490F38B99F5AB0F607A
CD4113852670A85F4A70216906C382BF2720C285E19FB26D227BC6C23BD93734
BEC84C3AEEB5CEAD5D549F55B676EF4FCFA195B776303FBF6948EC5F50A0D429
645C14EAF9C24767D71F05E29750A0FAD6707C0C72C905C9033A1ED45B58BDB1
77B639EA1BFD9F8C8A76472DDB9290DF46668ECD27F05FE81B6FD62C9E5C2773
96FBBC42B4D685284EEF5E00D032FAF2FC8486CACBB8B3CB08A737D8E6DC39F6
B62D18A44EF010B8738A8E7E42EF271FAAC28D451BD91D6BF557DA2108F04D8E
300D5855157C4C4E89ECCA2AC42D59479FE2A75D28ECB2FC458F696D2FE5EEAF
B7C0D47C5798FE2F573D943FD28285E692EE74EAA8FFB56F9C89053D9F3648E8
EAFF3619556431F6C6DCF67BC514EF53C776119992ECFB4BF41AC8076F208C64
5EC4C43C17EA3AEBB61FBF3277A15CC50E90C9FD2053138F97B1C764028F5833
47750520588B494F43AC7E6EB7F8283198949EDE44351FEE3FB65258F1E670A9
D25B0D61053F8275B32F536C145D76F2CE1026756D138F991A3328675F9F9934
03F5E210CD95B68E9859D8076FA580F844626FC5F17A39774AB2C2D990E36121
E49D0D84BDEA2B103B48A273A6B5C5EAFAF53BE51347A399D664F0734C4DDEAC
ECC61D0296B5F9743532A323D97D3EE3881B38996CCA68697DB8874918248976
9C6FC1F0BA3943CC4F42DA4B5064633A4A50787346B6E27A3969717EA18647CD
6CEEDCD44B2233B5F16D71161D33EA807F7E49B3D8AEB5B39A88C71CE1FCD448
03ED3AA7BF10F4950BD78B050A8BDE9B405983C7D32F74C534C2B5AD82101711
1B839F0AC29655E9C618DBCB729882D912009B14F4E9802BA921C2548EE8E474
B6227A30F6C2134FA1E1043E227A4E6D00685E3C81DD1317451B98EA2089571F
B90A5B09EBE02F599359C6A1E04C4AEBC80149AC2DFDA024925C2350914F86CF
810418324F5232BBD4F02B8B68099E9C0B21A7240586C5384240F0AA618612C3
3D323DEE89087C37E40C34F7D2C605F0B3309CFF566777CB268AE29A77F3078C
27DED2425186D63C45B6C27AC5EB57390FF8591B04EC3A290A606D8C09BE8B61
ECC479BCFB9238E19063B8E5A7C88C96C39523933B29A5EEF8A95829DF29A58F
0996F1172ABC600E334E5B5EE0905893F74B2A42720DC38D024437219DD9F79A
A9B46F696C2BB43FA7219178B611067966FCC28569BE0BEB69F797BE8C56B286
60C6A7318BA0B2F8E875038F4C5C2EA4009229E820C0A3202C805ED1C2254E09
87B4E47963EC15A3C0FAA32724E67E517BAE097532917BCF49A12CEB3D3B34BE
8D7E74641AA8CCD4AEF62F8E9681BC91E20618296578E5D4C03190BBB437E262
40FD38A3745134873CECD0E551431BDA7B5203B2933D7C42D702D89FDDCD0316
2949B4184BC5C42B8A439AE963E5082CA158B63F585224CBB3DFE303199DF04E
EE6A236C577A1E79D49408268FB0BC6CD3386ADA765EA3D7568624426EA9509E
7BB5FD230DD15542341E69C92838B5EF1181848DF54CE63D8D05AA0C811AB485
1868F840CC98E6F13240BE3473697EB452C06BDD61C591E5FEF9CD4D2955F317
613AF0B6231A3E2A2E1D530B1ABAA8488C1928F0A47C3B3C0974F91A1009E21B
9ADD7C514A20B89A9EFE4AD77CF3C098994BEB2E242C21FEF1ABD917F357244D
C0E60672CCED649D2477E5BEA75BCA2522C59934398EE996F65440E94CEF100B
6586C8BC39FFB8E4CE21533B222D61DD93D1ACDBD32CEE4776B57DA238E7FF54
0F82316445232762199EEC3AB2CA5FA7E354FB69556C417ED39CE071C31D6EF7
869487796A416FBDD9A1CB232B6F9E1105506409F58EBB8F3BD459ABE22F5FAC
4467D525C7F50298B1C85A96DB4D4E822D6BB42E3C505090D5339EEB7B39C4E9
BE0AEF3CDDD6A3C63A1FCC994D877DC795AD20002BA641F2E92713B1DF817B0B
0DCE9724E0F45460B811564511290A2507F2A942F78306D755FC6E545E384A18
A099B768259109A51AF39F9A352848B8E282C8C79B2610CF8B67C4195BC63143
4558802D61AD0347F97A79AA84CFEDDA3D0F1CD77F81442284903C4FCE9B0A6E
3045F9830E8B83F6AEFF55B840CA8CF9146E60D14DD5287C3BEC27D1A0BD355B
EA4E5D4B67361EDEDFBB7A0E6183C08321CDD3576A580E1A72C05DA05885F899
355CB3417B682D37D2C46512BB5FCA67A2BEF552F8E07DFB47E1858AF93315C8
EBB97EEE953ECD1564E288526FFB40BEFF34838B79FCF60A56B1E3F88577D7A4
61A5EFC912AB8CB741F2435A1223806353585B1F28AD519EAE00ADDFAC77695D
6E2A313A0CE0D0010BC36CAEA11D564169C1B679ADB9FA68C9A845DF5E665145
6BF0C1845630E226162A8A08EC805014EAF4562588A8505181E9F8E5F9EFBF78
1518DE3CA3A4B32C1BCC69FA4D5E32F5791EC1534C0B7F665F62E34C4CEB23B4
96EE5E8889FFECA9B3F78E242CDF1C52A443ADAB09FFC938F17A1508D3FC305E
B0285802159483285A81158FD2C127EDADB57AE4246BE28309C78C09B581F28F
ED568FFF539D00E73449D35C7A377880B2BD7372F811D518CFA364F125A376F8
A6CE235FCB35CCF828BAD131E2E85545467BE70B23EC91974E8814583546C7E0
23CA1694931CB5F8EFE6236DD16228D9847251FFE9EC0D617A54E4350BDE36AF
3D185107
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
cleartomark
%%EndFont 
%%BeginFont: CMSY8
%!PS-AdobeFont-1.1: CMSY8 1.0
%%CreationDate: 1991 Aug 15 07:22:10
% Copyright (C) 1997 American Mathematical Society. All Rights Reserved.
11 dict begin
/FontInfo 7 dict dup begin
/version (1.0) readonly def
/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def
/FullName (CMSY8) readonly def
/FamilyName (Computer Modern) readonly def
/Weight (Medium) readonly def
/ItalicAngle -14.035 def
/isFixedPitch false def
end readonly def
/FontName /CMSY8 def
/PaintType 0 def
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0] readonly def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
dup 0 /.notdef put
readonly def
/FontBBox{-30 -955 1185 779}readonly def
/UniqueID 5000818 def
currentdict end
currentfile eexec
D9D66F633B846A97B686A97E45A3D0AA052F09F9C8ADE9D907C058B87E9B6964
7D53359E51216774A4EAA1E2B58EC3176BD1184A633B951372B4198D4E8C5EF4
A213ACB58AA0A658908035BF2ED8531779838A960DFE2B27EA49C37156989C85
E21B3ABF72E39A89232CD9F4237FC80C9E64E8425AA3BEF7DED60B122A52922A
221A37D9A807DD01161779DDE7D5FC1B2109839E5B52DFBB2A7C1B5D8E7E8AA0
5B10EA43D6A8ED61AF5B23D49920D8F79DAB6A59062134D84AC0100187A6CD1F
80F5DDD9D222ACB1C23326A7656A635C4A241CCD32CBFDF8363206B8AA36E107
1477F5496111E055C7491002AFF272E46ECC46422F0380D093284870022523FB
DA1716CC4F2E2CCAD5F173FCBE6EDDB874AD255CD5E5C0F86214393FCB5F5C20
9C3C2BB5886E36FC3CCC21483C3AC193485A46E9D22BD7201894E4D45ADD9BF1
CC5CF6A5010B5654AC0BE0DA903DB563B13840BA3015F72E51E3BC80156388BA
F83C7D393392BCBC227771CDCB976E93302530FA3F4BEF341997D4302A48384A
CEFFC155983607ED44ED8BB0F2E1ECA433708ADC448491EE34E5DE6387C31A7E
DCF2EA2BD9D34874BA24E7890A4D439123FC08F165C103EC279DE5EA68EA8297
E6AC3FFF3F15BA263EF1A0B6F158C59FFA893535D961F306F33EC80849E2C642
1AA4B3506CCDF2635B07582676F8B20BA58C498650410C92A6E81E135BCE79B7
89E572C6B118695164E031F6288FA34E1E695ECBBB704877860E030EE8FE908B
9A9352DBF53B779DA608B7E82EA0DFD24D3DFF0F52A2A8379BB2C03F6581E2C0
65EF423EBAB253F569641118D9E4A1F5E96ED14D6B28A3A5C25835F6A4D638E0
B75440D8C13B6536472F0885B468B88D37753B3A0F6EA7B9D81CA8226C9CB399
00CFB777974DF4EF5B00C999622218761A1E151A26E13A74AB12F5B2235FAAE1
37E0F5E5137479885795B50B0AFD6920A7A00954B314CBC3B97D84B5BDBA1685
4FC5CB2144863113D0DD754E34A61DE8E126F22F6926C43DFE5C36B06FFF4ED6
578CBAADE26838507FA8FF89E020960E393F9013D5C5D3E643F316A28E4AB4EC
A97714283A35EED8A9ACAB99AC272AB61059A1F769FCE6FED93AC9DA1AE528E4
52ECA96E28
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
cleartomark
%%EndFont 
%%BeginFont: CMSY10
%!PS-AdobeFont-1.1: CMSY10 1.0
%%CreationDate: 1991 Aug 15 07:20:57
% Copyright (C) 1997 American Mathematical Society. All Rights Reserved.
11 dict begin
/FontInfo 7 dict dup begin
/version (1.0) readonly def
/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def
/FullName (CMSY10) readonly def
/FamilyName (Computer Modern) readonly def
/Weight (Medium) readonly def
/ItalicAngle -14.035 def
/isFixedPitch false def
end readonly def
/FontName /CMSY10 def
/PaintType 0 def
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0] readonly def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
dup 0 /.notdef put
readonly def
/FontBBox{-29 -960 1116 775}readonly def
/UniqueID 5000820 def
currentdict end
currentfile eexec
D9D66F633B846A97B686A97E45A3D0AA052F09F9C8ADE9D907C058B87E9B6964
7D53359E51216774A4EAA1E2B58EC3176BD1184A633B951372B4198D4E8C5EF4
A213ACB58AA0A658908035BF2ED8531779838A960DFE2B27EA49C37156989C85
E21B3ABF72E39A89232CD9F4237FC80C9E64E8425AA3BEF7DED60B122A52922A
221A37D9A807DD01161779DDE7D31FF2B87F97C73D63EECDDA4C49501773468A
27D1663E0B62F461F6E40A5D6676D1D12B51E641C1D4E8E2771864FC104F8CBF
5B78EC1D88228725F1C453A678F58A7E1B7BD7CA700717D288EB8DA1F57C4F09
0ABF1D42C5DDD0C384C7E22F8F8047BE1D4C1CC8E33368FB1AC82B4E96146730
DE3302B2E6B819CB6AE455B1AF3187FFE8071AA57EF8A6616B9CB7941D44EC7A
71A7BB3DF755178D7D2E4BB69859EFA4BBC30BD6BB1531133FD4D9438FF99F09
4ECC068A324D75B5F696B8688EEB2F17E5ED34CCD6D047A4E3806D000C199D7C
515DB70A8D4F6146FE068DC1E5DE8BC57034F7455AB67138A1B6DFCA01660EDA
B80764458B5829EB2FEC53E0A1F53FF5AF7A2E1564E666101BC844AB50DE3860
2235ECED71E86452D47F2A3E0D887538BAFE377CFC4DD49B397BEE459E06CA48
29B9E43C4C347E647725BC1EF122B368DDE812998D429F648E69E50AD0677E4F
7DF4141D36DB8E851E5082B4FEBAABC181B0CBA7F8BBB9752221FD744FDFDA73
0EBCBCD6D303927FEE493B106FF9DEDDA6EA3D79EFDAE0C063218915C60BEAC9
EA7EF4A8A0FDAE52C7390A7EF58DDB46384B615BAC1512C5CB58C7EC10E35013
812BA234E65061F364B2001E589DF2DA850322315B1797BBEEA9BF7B531859EA
A5B748A56385CA50FE153ADE0365870067ABCF6E089660983600BAB334B80D8B
A7F93CAA428E03CC9A23B1A1E7B80742BD841B0C1AC320C179E9CE0E6A1B61D9
318C021876C083C5229C8C8C82A45F5B70BE6F2C35ECEC4DAC4365B7B2F2D6E9
29F65FDEA14904A3E0CC8713630FDC80848AFA3E375E14DA9E692E87F3F1AD44
36090A9E42CCA95E9163E549DD91A8913B4F450F0409169E4B0A5C845957F696
860169D2B2489962DB2C30992336807698E9FF4ED33EB0DFBAEC3516019921DB
4C7B941293F170AA707AD416C6F3691E85B93CFA4790B24F56ADDD54C937D426
499E3A4F47A34D9AE8722BD85FC22EA84ED19743751ABFC6D087BF660C7C6283
BD78E35BDBE782C9D00A5A2893DB4E13814F1413707E84A906A4633545D8CA8C
C452DE176A8341290AD26B373CC2797C7E287072021694D77FB7972EC69B2A3C
95DB6F6F09DB25292D9AFE9CBCF9BD0424AB594869B6882DD376B24DFAE9F490
39DAA160EEC983B87D97B0ED75C045E8775937525963EF7A020B75910212B066
E0B83BD188203BEB20AFE99A9C16D85146C94659EA69F11283192C6CF189A01E
FABA21195643459CCB4127C714874A1F9E4377E43F409ACD541214F146D44286
61901BC9BC75B41DA1EDBF7B12B5A4C914B24021E82B8FD49C5D0B4A918582E7
9D8F8EE647C864702895B71199DBA6E27A616E94D666886E27D7FA4D39A3A137
E4B60D93EF3B639FF10C4AF7771A9C9C0A2819AC5491FD8B1733DBE9413DF300
19263F0FB01112FC504B7DCE1D92D1806414B54C48054043C7C5135710B1F679
0B1014E6FA29764EBFBD57D1DE3E932CEC7BC609EDF7A39B1E3B2224C6D35F66
718CE858807E0E8F95F8E08D800CC4CDD2878FA0DA4B1AE8991B8ACE68B7D195
45C5FCE27A89B42B70BEEDA694E97EEB7E1FF648FD0B11DC5816057D6214543E
4F7D9C237BC81D303AC1C2C47709AF77DE6238DA6ABDCDA6D4829004F48FA8BB
7D4D5044C6D6DC3ECCF51172EAF88E0146CB2BB3C897CA8B37B4EAA0D58CCECC
BE9FE5A7E6BE2DA97AC5A0732442E28CCA397B87F5ADDC951CA1935A434E363C
6A8A08472905939F6B2BB360878E1ABAAA7C856BFF9EAC25A97FA2787F2B2EC9
DABDAA372A6D637458C34F101BBC774D1BC3C7FC98DFDC87DFD69AC2AF52DDAB
69C26CE1B96CA7536E682B1E600EC8562938DCF7E0A5B649238A36263FBDA1B1
03CA7727623A914345A6DB992C8478500A9970238B28539FE7C2A583DFFF45A0
B3347C402742BE80CEA9492285159AFC3941DB89D125D9D88291397A7E4107E5
BF4BFC9E0C7BC32F930FF6CF620E26BAB5DAAEF0C4CC2C0D60C49D8EAA0EFF87
66778155EBB072E7AF12AFDFF2710A1D161E8C974792D92B68C880B729212BAA
92B4E4B02692308A2D3EDEBA765030E30ACA5AABA31F9C00B9C2727791AE0D4A
7CD173EA9B57E80B942FC8BBFEF2F26780E425E22EBC34AED1CCBCDD87124733
569D5529B64817FD1D5DFBE01F71DDDCF54AC951C44A7454477B4CA7C4B6D183
5C73A9D38B29CF9629C71F44C10E0F862B0866272F76E79F5AE725B1ADA4E5BC
D901041C8DD28239B4DC614F715ECF97A01E9EBA16DF23EC051B49853E80DEE3
FFBF1453DDD1B2AF75C55311AC792B703DA551090F68647D3CE82CC2C9A732E8
BFB905AD36AE882DCEF1C8455011AF92723C19981F7900B47118FC36C9
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
cleartomark
%%EndFont 
%%BeginFont: CMR8
%!PS-AdobeFont-1.1: CMR8 1.0
%%CreationDate: 1991 Aug 20 16:39:40
% Copyright (C) 1997 American Mathematical Society. All Rights Reserved.
11 dict begin
/FontInfo 7 dict dup begin
/version (1.0) readonly def
/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def
/FullName (CMR8) readonly def
/FamilyName (Computer Modern) readonly def
/Weight (Medium) readonly def
/ItalicAngle 0 def
/isFixedPitch false def
end readonly def
/FontName /CMR8 def
/PaintType 0 def
/FontType 1 def
/FontMatrix [0.001 0 0 0.001 0 0] readonly def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
dup 0 /.notdef put
readonly def
/FontBBox{-36 -250 1070 750}readonly def
/UniqueID 5000791 def
currentdict end
currentfile eexec
D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891
016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171
9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F
D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758
469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8
2BDBF16FBC7512FAA308A093FE5CF4E9D2405B169CD5365D6ECED5D768D66D6C
68618B8C482B341F8CA38E9BB9BAFCFAAD9C2F3FD033B62690986ED43D9C9361
3645B82392D5CAE11A7CB49D7E2E82DCD485CBA1772CE422BB1D7283AD675B65
48A7EA0069A883EC1DAA3E1F9ECE7586D6CF0A128CD557C7E5D7AA3EA97EBAD3
9619D1BFCF4A6D64768741EDEA0A5B0EFBBF347CDCBE2E03D756967A16B613DB
0FC45FA2A3312E0C46A5FD0466AB097C58FFEEC40601B8395E52775D0AFCD7DB
8AB317333110531E5C44A4CB4B5ACD571A1A60960B15E450948A5EEA14DD330F
EA209265DB8E1A1FC80DCD3860323FD26C113B041A88C88A21655878680A4466
FA10403D24BB97152A49B842C180E4D258C9D48F21D057782D90623116830BA3
9902B3C5F2F2DD01433B0D7099C07DBDE268D0FFED5169BCD03D48B2F058AD62
D8678C626DC7A3F352152C99BA963EF95F8AD11DB8B0D351210A17E4C2C55AD8
9EB64172935D3C20A398F3EEEEC31551966A7438EF3FEE422C6D4E05337620D5
ACC7B52BED984BFAAD36EF9D20748B05D07BE4414A63975125D272FAD83F76E6
10FFF8363014BE526D580873C5A42B70FA911EC7B86905F13AFE55EB0273F582
83158793B8CC296B8DE1DCCF1250FD57CB0E035C7EDA3B0092ED940D37A05493
2EC54E09B984FCA4AB7D2EA182BCF1263AA244B07EC0EA901C077A059F709F30
4384CB5FA748F2054FAD9A7A43D4EA427918BD414F766531136B60C3477C6632
BEFE3897B58C19276A301926C2AEF2756B367319772C9B201C49B4D935A8267B
041D6F1783B6AEA4DAC4F5B3507D7032AA640AAB12E343A4E9BDCF419C04A721
3888B25AF4E293AACED9A6BDC78E61DA1C424C6503CC1885F762BCA9D2C2FD74
7B8DD210DB4E177D8A0977561ED07C977C66DED66FAC9701C4EA687BCDB9E908
E6B1D91F0DDFF89741309DE7BDD2D1BBBA5510F6C73AC4FB39C52A795396A53F
3B043AD6953AE42B99318F97549888B2ADBC42B468CE855E2DBDDF60EDEC2431
D33EB72DE1F2940422A5FD7D6410E8C2740552496B695D84B83DA5BD942A54D1
47196D80C0500B368563193DB6F0C9BE218EA08658458DB8CC529F20881ECCB9
3718AEFC2215CDCD0CFA969E2EA996FABF13B4B46AABC221195ED09651689AFD
D96972BA6AB5349949DF910FB5491B1C6C5C1415F12E82812997780C5D6ACD24
35EAB20E4089E7FC90E73CDB4840596A6CFE86BCE4B3143F741FA92CC43A12F4
90CE0D95F408AAC8327573C481B560B2DFBD8CE88B992813AC84326953A6D836
3F0AD03C814EB2E2962A1BCE4E0083927D781985258CAB91CE04F401D76DBBF9
3E8722019C66F61658F63B1FA0D82607748EE3E0A61E04DA5A78A95C8F498C0D
501273128A1DDA86822203D1AE03780763AC49EF09136F308C254519930A579A
71D8629D893EE4AF17277D1A8C209E2055327B5D6EF7161FB726D2F72BF333B8
CFDA66970D270B5B670FD454E9B5E4B2A98F55B9724FA6071DAEA3B289B4EC0A
4930F2AECFE5730FC4387EF694FFB57B231B9254B9E5480931DA8D7B90563ADD
1E2FBCE3B0AB85B2CFF74E93199461BF7733EBDC6B0010EC6036270873BBB499
50BA24CBE38736DF5C9A349C6AA01C097E3FEF93D8AE5925236F02DD6D406377
7721B21413A88856DDC2C4D71B4D403CF339725BEDD6188BAB61E2CFF2B8DBDB
0F57D84B9F4AE7C6842F5F4F53949B792013E71A8176825AA4A54D77AB25C86F
BAB27782A4536309B5695DAEF6A5E0081155244D61DA585CD413AD5E25E39D9A
444632398D68DF83BF1E28706A214BAD6FF5B40CA2AD245F99B5FBC41367EF60
57160D04BF7D106CF4B03AB215524364DB34629FE3B5C2908319FF7B7A68D48C
55D1A89DC3F24EE2B27A5E07745646AC96C591348BD3946FE253934BEF72F627
6384BD9AAFD7E0D40114FD4F099674E405F979D04FC7B20294CA8FCE0E6FF539
508EF41335824095E948B0C2E91F2C7358A1988BCF91B50B69509E1349A6B4BC
01F04A30B1C3853A4F24F5595562839F21A92D2B5B51BE9B987CC28AB53E29B3
6DB9AA76E007051BA30F80DC01E0DD3B288CC59CA2EB54B8AD9A4E6C2E24FFCE
86CACC4ECD070AE7F07166C8FDF7F3404867438D695C62B999CEA346968EA86B
40FA39729042F8AD276AAF90C453E55B6A2F7FA7EC877F8240134A2BAA631AF1
5E166C1479B76183AF370EB865B18849B63DDFEFE4F4D56B3E134AFA5999CB56
3E71D0B10157397787F361439A2D37A388F91CB973AD9B58B3290E45D03D5D37
B8113DEFE6BA1518167B5BDE10B1404C668CB328AEE160D153D1202AA28F8611
DEFCB9EE7A5B4505A6348B3B6C5FD2CD424E4654C50FBFAEF9E3BB6EE6FCD2B4
E2FBFC68A430FBFBA7180F322AB1085A26075B7FB4BFD76D8DB7A72B2305E78B
FE3F9E8DE02513121120AD69ACA4593D7F425C3597
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
cleartomark
%%EndFont 
TeXDict begin 39158280 55380996 1000 1200 1200 (manual.dvi)
@start /Fa 103[100 15[100 10[100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100 100 1[100 100
100 100 100 100 100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100 100 100 100 100
100 100 100 33[{ TeXBase1Encoding ReEncodeFont }94 166.044
/Courier rf /Fb 201[66 4[66 66 48[{ TeXf7b6d320Encoding ReEncodeFont }3
116.231 /CMR7 rf /Fc 133[83 92 86 138 94 100 54 70 66
93 100 91 97 147 48 92 39 48 97 92 55 80 101 74 92 83
7[111 111 1[120 129 102 87 111 131 100 131 138 157 101
121 1[56 138 127 92 101 129 118 101 129 12[83 83 83 83
3[55 41[101 100 2[{ TeXBase1Encoding ReEncodeFont }56
166.044 /Palatino-Roman rf /Fd 145[86 4[48 105[{
 TeXaae443f0Encoding ReEncodeFont }2 132.835 /CMMI8 rf
/Fe 134[109 2[109 109 109 109 109 1[109 109 109 109 109
2[109 109 109 1[109 109 109 109 109 51[109 45[{
 TeXBase1Encoding ReEncodeFont }20 181.818 /Courier-Bold
rf /Ff 135[120 2[120 120 1[120 12[120 120 120 1[120 14[120
8[120 3[120 69[{ TeXBase1Encoding ReEncodeFont }11 199.253
/Courier rf /Fg 134[111 100 166 111 122 66 88 78 122
122 111 122 177 66 122 66 66 122 111 78 100 122 88 122
100 8[133 199 3[122 144 1[122 166 2[122 155 1[78 1[166
111 122 166 144 1[155 7[100 100 100 100 100 100 100 100
100 100 1[50 66 42[122 2[{ TeXBase1Encoding ReEncodeFont }53
199.253 /Palatino-Bold rf /Fh 134[89 104 1[88 7[109 4[63
2[89 22[139 146 10[130 4[141 1[141 51 51 42[74 15[{
 TeXaae443f0Encoding ReEncodeFont }14 181.818 /CMMI10
rf /Fi 144[91 2[51 4[91 11[51 29[141 3[91 3[91 1[91 91
91 91 4[141 1[71 71 40[{ TeXf7b6d320Encoding ReEncodeFont }14
181.818 /CMR10 rf /Fj 207[38 44[71 3[{
 TeXbbad153fEncoding ReEncodeFont }2 132.835 /CMSY8 rf
/Fk 147[143 143 1[143 2[143 143 3[143 19[143 41[143 35[{
 TeXBase1Encoding ReEncodeFont }8 239.103 /Courier rf
/Fl 149[51 71 71 91 91 60[182 7[182 12[141 4[91 14[141{
 TeXbbad153fEncoding ReEncodeFont }10 181.818 /CMSY10
rf /Fm 133[120 133 120 199 133 146 80 106 93 146 146
133 146 213 80 146 1[80 146 133 93 120 146 106 146 120
9[239 1[186 159 146 173 199 146 199 1[239 146 2[93 199
199 133 146 199 173 159 186 7[120 120 120 120 120 120
120 120 120 120 71 60 80 42[146 2[{ TeXBase1Encoding ReEncodeFont }58
239.103 /Palatino-Bold rf /Fn 198[71 3[71 71 1[71 71
71 48[{ TeXf7b6d320Encoding ReEncodeFont }6 132.835 /CMR8
rf /Fo 135[172 3[115 1[134 1[210 1[210 4[115 210 2[172
210 2[172 29[249 1[268 8[172 172 172 172 172 172 172
172 49[{ TeXBase1Encoding ReEncodeFont }20 344.375 /Palatino-Bold
rf /Fp 103[109 15[109 10[109 109 109 109 109 109 109
109 109 109 109 109 109 109 109 109 109 109 109 109 109
109 109 109 109 109 109 109 109 109 109 1[109 109 109
109 109 109 109 109 109 109 109 109 109 109 109 109 109
109 109 109 109 109 109 109 109 109 109 109 109 109 109
109 109 109 109 109 109 109 109 109 109 109 109 109 109
109 109 109 109 109 109 109 109 109 109 109 109 109 109
109 109 33[{ TeXBase1Encoding ReEncodeFont }94 181.818
/Courier rf /Fq 104[182 29[101 91 151 101 111 61 81 71
111 111 101 111 162 61 111 1[61 111 101 71 91 111 81
111 91 8[121 182 141 141 121 111 131 1[111 151 1[182
111 2[71 4[151 131 121 141 7[91 91 91 91 91 91 91 91
91 91 1[45 61 45 4[51 36[111 2[{ TeXBase1Encoding ReEncodeFont }56
181.818 /Palatino-Bold rf /Fr 134[230 207 344 1[252 138
183 161 1[252 230 252 367 138 252 1[138 252 230 1[207
252 183 252 207 8[276 2[321 276 252 2[252 344 1[413 252
2[161 5[298 276 321 8[207 3[207 12[115 39[{
 TeXBase1Encoding ReEncodeFont }36 413.118 /Palatino-Bold
rf /Fs 64[91 27[91 40[81 91 91 131 91 101 61 71 71 84
91 81 101 141 51 81 1[51 91 91 51 71 91 74 84 81 3[61
1[61 4[131 141 111 101 121 1[111 141 141 172 101 121
1[61 141 131 101 111 141 121 1[131 1[91 6[91 3[91 2[91
91 1[45 61 45 110 1[61 61 51 35[99 96 2[{
 TeXBase1Encoding ReEncodeFont }62 181.818 /Palatino-Italic
rf /Ft 94[51 9[182 91 1[91 91 24[91 101 94 152 103 110
59 77 72 102 109 99 106 161 53 101 43 53 106 101 61 87
111 81 101 91 51 2[61 1[61 1[121 121 182 131 141 111
95 121 143 110 143 151 172 111 132 61 61 151 139 101
111 141 129 111 141 136 81 1[110 1[45 45 91 91 91 91
91 91 91 91 91 91 110 45 61 45 110 71 61 61 51 35[111
110 2[{ TeXBase1Encoding ReEncodeFont }85 181.818 /Palatino-Roman
rf /Fu 138[173 2[113 3[167 253 83 3[167 1[96 137 1[127
1[143 13[151 192 4[271 20[143 3[143 52[{ TeXBase1Encoding ReEncodeFont }
15 286.924 /Palatino-Roman rf /Fv 134[111 4[65 84 79
1[120 109 116 176 58 111 1[58 116 1[66 95 122 88 110
100 12[122 105 133 4[188 1[145 66 67 22[100 100 2[50
46[{ TeXBase1Encoding ReEncodeFont }28 199.253 /Palatino-Roman
rf end
%%EndProlog
%%BeginSetup
%%Feature: *Resolution 1200dpi
TeXDict begin
%%PaperSize: A4
 end
%%EndSetup
%%Page: 1 1
TeXDict begin 1 0 bop 2899 4884 a Fv(The)51 b(Incomplete)1738
5249 y Fu(Scheme)73 b(48)f(Refer)-5 b(ence)74 b(Manual)2983
5614 y Fv(for)50 b(r)l(elease)h(1.2)1156 6392 y(Richar)l(d)e(Kelsey)551
b(Jonathan)49 b(Rees)551 b(Mike)51 b(Sperber)p eop end
%%Page: 2 2
TeXDict begin 2 1 bop 787 1146 a Ft(A)46 b(line)f(may)g(take)h(us)f
(hours,)g(yet)h(if)f(it)h(does)g(not)f(seem)h(a)f(moment's)g(thought)
787 1372 y(All)g(our)h(stitching)f(and)g(unstitching)g(has)g(been)g(as)
h(nought.)4183 1797 y(Y)-17 b(eats)4183 2022 y Fs(Adam')-10
b(s)45 b(Curse)3699 12141 y Ft(ii)p eop end
%%Page: 3 3
TeXDict begin 3 2 bop 166 2474 a Fr(Acknowledgements)166
3397 y Ft(Thanks)81 b(to)h(Scheme)f(48's)f(users)h(for)g(their)g
(suggestions,)91 b(bug)80 b(r)m(eports,)91 b(and)81 b(forbearance.)166
3623 y(Thanks)46 b(also)f(to)h(Deborah)f(T)-17 b(atar)46
b(for)f(pr)m(oviding)g(the)h(Y)-17 b(eats)46 b(quotation.)3507
12141 y(iii)p eop end
%%Page: 4 4
TeXDict begin 4 3 bop 332 2481 a Fr(Contents)332 3568
y Fq(1)182 b(Introduction)5424 b(1)332 3991 y(2)182 b(User)10
b(')-10 b(s)44 b(guide)5441 b(2)605 4225 y Ft(2.1)191
b(Command)45 b(line)g(ar)m(guments)110 b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)h(.)249 b(2)605 4460 y(2.2)191 b(Command)45 b(pr)m(ocessor)136
b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)249
b(3)605 4695 y(2.3)191 b(Editing)124 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)249
b(3)605 4930 y(2.4)191 b(Performance)100 b(.)92 b(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)
f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)249 b(3)605
5164 y(2.5)191 b(Disassembler)50 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)249 b(4)605 5399
y(2.6)191 b(Module)45 b(system)161 b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)h(.)249 b(4)605 5634 y(2.7)191
b(Library)117 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)h(.)249 b(5)332 6056 y Fq(3)182
b(Command)45 b(processor)4773 b(7)605 6291 y Ft(3.1)191
b(Curr)m(ent)45 b(focus)f(value)h(and)g Fp(##)145 b Ft(.)92
b(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)249 b(7)605 6526 y(3.2)191
b(Command)45 b(levels)173 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)h(.)249 b(8)605 6761 y(3.3)191 b(Logistical)46
b(commands)98 b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)249
b(8)605 6995 y(3.4)191 b(Module)45 b(commands)109 b(.)91
b(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)249
b(9)605 7230 y(3.5)191 b(Debugging)44 b(commands)113
b(.)92 b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)249 b(9)605
7465 y(3.6)191 b(Switches)145 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(10)605
7699 y(3.7)191 b(Inspection)46 b(mode)58 b(.)91 b(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(12)605 7934
y(3.8)191 b(Command)45 b(pr)m(ograms)127 b(.)91 b(.)h(.)f(.)g(.)h(.)f
(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)h(.)158 b(13)605 8169 y(3.9)191 b(Building)45
b(images)87 b(.)k(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
h(.)158 b(14)605 8404 y(3.10)100 b(Resour)m(ce)45 b(query)g(and)h
(contr)m(ol)141 b(.)92 b(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(14)605 8638 y(3.11)100 b(Thr)m(eads)66 b(.)92 b(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(15)605 8873 y(3.12)100 b(Quite)45 b(obscur)m(e)143
b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(16)332 9296 y Fq(4)182 b(Module)45 b(system)5106 b(17)605
9530 y Ft(4.1)191 b(Intr)m(oduction)114 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(17)605
9765 y(4.2)191 b(The)46 b(con\002guration)f(language)132
b(.)92 b(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(18)605 10000
y(4.3)191 b(Interfaces)73 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(20)605 10235
y(4.4)191 b(Macr)m(os)129 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(21)605
10469 y(4.5)191 b(Higher)m(-or)m(der)45 b(modules)136
b(.)92 b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(21)605
10704 y(4.6)191 b(Compiling)45 b(and)g(linking)110 b(.)92
b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(21)605
10939 y(4.7)191 b(Semantics)45 b(of)h(con\002guration)f(mutation)105
b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)h(.)158 b(22)605 11174 y(4.8)191 b(Command)45
b(pr)m(ocessor)g(support)138 b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(23)605 11408 y(4.9)191 b(Con\002guration)45 b(packages)164
b(.)91 b(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)
f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(25)605
11643 y(4.10)100 b(Discussion)117 b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(27)3674
12141 y(iv)p eop end
%%Page: 5 5
TeXDict begin 5 4 bop 166 1146 a Fq(5)182 b(Libraries)5636
b(29)439 1375 y Ft(5.1)191 b(General)45 b(utilities)116
b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(29)439 1604 y(5.2)191 b(Pr)m(etty-printing)59 b(.)91
b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(30)439 1833 y(5.3)191 b(ASCII)47 b(character)d(encoding)156
b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(31)439
2062 y(5.4)191 b(Bitwise)45 b(integer)h(operations)118
b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(31)439
2292 y(5.5)191 b(Byte)46 b(vectors)145 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(31)439
2521 y(5.6)191 b(Sparse)46 b(vectors)109 b(.)91 b(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(32)439
2750 y(5.7)191 b(Cells)46 b(.)92 b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(32)439
2979 y(5.8)191 b(Queues)104 b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(32)439
3208 y(5.9)191 b(Arrays)164 b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(33)439
3438 y(5.10)100 b(Recor)m(ds)73 b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h
(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(34)857
3667 y(5.10.1)128 b(Low-level)44 b(access)i(to)g(r)m(ecor)m(ds)131
b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)g(.)159 b(35)857 3896 y(5.10.2)128 b(Recor)m(d)45
b(types)181 b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(36)439 4125 y(5.11)100 b(Finite)45 b(r)m(ecor)m(d)g(types)175
b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(37)439 4354 y(5.12)100 b(Sets)46 b(over)g(\002nite)f(types)145
b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(38)439 4583 y(5.13)100 b(Hash)45 b(tables)53 b(.)91
b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
159 b(39)439 4813 y(5.14)100 b(Port)46 b(extensions)169
b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(40)439 5042 y(5.15)100 b(Fluid)45 b(bindings)83 b(.)91
b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(41)439 5271 y(5.16)100 b(Shell)46 b(commands)73 b(.)91
b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(42)439 5500 y(5.17)100 b(Sockets)119 b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(43)439 5729 y(5.18)100 b(Macr)m(os)45 b(for)g(writing)g(loops)93
b(.)e(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(44)857
5959 y(5.18.1)128 b Fp(Iterate)55 b Ft(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(44)857 6188 y(5.18.2)128
b Fp(Reduce)164 b Ft(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)159 b(45)857 6417 y(5.18.3)128 b(Sequence)45
b(types)130 b(.)92 b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(45)857 6646 y(5.18.4)128 b(Synchr)m(onous)45 b(sequences)137
b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(46)857 6875 y(5.18.5)128
b(Examples)171 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
g(.)159 b(47)857 7104 y(5.18.6)128 b(De\002ning)45 b(sequence)f(types)
82 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(48)857 7334 y(5.18.7)128
b(Expanded)45 b(code)120 b(.)92 b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
g(.)159 b(48)439 7563 y(5.19)100 b(Sorting)46 b(lists)g(and)f(vectors)
155 b(.)91 b(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(49)857
7792 y(5.19.1)128 b(Design)45 b(r)o(ules)83 b(.)91 b(.)g(.)h(.)f(.)g(.)
h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(49)857 8021 y(5.19.2)128
b(Pr)m(ocedur)m(e)44 b(speci\002cation)172 b(.)92 b(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
159 b(52)857 8250 y(5.19.3)128 b(Algorithmic)45 b(pr)m(operties)64
b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(59)439 8480 y(5.20)100
b(Regular)45 b(expr)m(essions)58 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)h
(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)g(.)159 b(60)857 8709 y(5.20.1)128 b(Character)44
b(sets)95 b(.)c(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(60)857 8938 y(5.20.2)128 b(Anchoring)89 b(.)j(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(61)857 9167 y(5.20.3)128
b(Composite)46 b(expr)m(essions)55 b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(61)857 9396 y(5.20.4)128 b(Case)45 b(sensitivity)106
b(.)92 b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(61)857
9626 y(5.20.5)128 b(Submatches)44 b(and)i(matching)58
b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)g(.)159 b(62)439 9855 y(5.21)100
b(SRFIs)127 b(.)91 b(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(63)166 10268 y Fq(6)182
b(Threads)5708 b(66)439 10497 y Ft(6.1)191 b(Cr)m(eating)45
b(and)g(contr)m(olling)g(thr)m(eads)147 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(66)439 10726 y(6.2)191 b(Advanced)45 b(thr)m(ead)g(handling)i(.)91
b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(67)439 10955
y(6.3)191 b(Debugging)44 b(multithr)m(eaded)h(pr)m(ograms)110
b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)g(.)159 b(67)439 11185 y(6.4)191 b(Optimistic)45
b(concurr)m(ency)59 b(.)92 b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(67)439 11414 y(6.5)191 b(Condition)46 b(variables)84
b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(70)439 11643 y(6.6)191 b(Mutual)45 b(exclusion)136
b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(71)3535 12141 y(v)p eop end
%%Page: 6 6
TeXDict begin 6 5 bop 1023 1146 a Ft(6.6.1)219 b(Locks)76
b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h
(.)158 b(71)1023 1376 y(6.6.2)219 b(Placeholders)64 b(.)91
b(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(72)605 1606 y(6.7)191 b(W)-13 b(riting)45 b(custom)g(synchr)m
(onization)f(abstractions)121 b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(72)332 2021 y Fq(7)182
b(Mixing)44 b(Scheme)h(48)g(and)h(C)4325 b(74)605 2251
y Ft(7.1)191 b(A)-17 b(vailable)45 b(facilities)67 b(.)92
b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(74)1023 2481 y(7.1.1)219 b(Scheme)45 b(str)o(uctur)m(es)174
b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(74)1023
2712 y(7.1.2)219 b(C)45 b(naming)g(conventions)96 b(.)91
b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(74)1023 2942 y(7.1.3)219
b(Garbage)44 b(collection)139 b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)
158 b(75)605 3172 y(7.2)191 b(Shar)m(ed)45 b(bindings)88
b(.)j(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(75)1023 3402 y(7.2.1)219 b(Exporting)46 b(Scheme)f(values)g(to)h(C)
180 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)h(.)158 b(75)1023 3632 y(7.2.2)219 b(Exporting)46
b(C)f(values)g(to)h(Scheme)180 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(75)1023
3862 y(7.2.3)219 b(Complete)46 b(shar)m(ed)f(binding)f(interface)75
b(.)92 b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
h(.)158 b(76)605 4093 y(7.3)191 b(Calling)45 b(C)g(functions)g(fr)m(om)
f(Scheme)111 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(77)605 4323
y(7.4)191 b(Adding)46 b(external)f(modules)g(to)h(the)g
Fp(Makefile)102 b Ft(.)91 b(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)158 b(77)605 4553 y(7.5)191 b(Dynamic)44
b(loading)144 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
h(.)158 b(78)605 4783 y(7.6)191 b(Compatibility)143 b(.)91
b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(79)605 5013 y(7.7)191 b(Accessing)45 b(Scheme)h(data)f(fr)m(om)g(C)
154 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(79)1023 5243 y(7.7.1)219
b(Constants)151 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)h(.)158 b(79)1023 5474 y(7.7.2)219 b(Converting)45
b(values)155 b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(79)1023 5704 y(7.7.3)219 b(C)45 b(versions)g(of)h(Scheme)f(pr)m
(ocedur)m(es)67 b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)h(.)158 b(80)605 5934 y(7.8)191 b(Calling)45
b(Scheme)g(functions)g(fr)m(om)f(C)111 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(81)605 6164 y(7.9)191 b(Interacting)45 b(with)h(the)f(Scheme)g(heap)
75 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(82)1023 6394 y(7.9.1)219
b(Registering)46 b(objects)f(with)g(the)h(GC)55 b(.)91
b(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)h(.)158 b(82)1023 6625 y(7.9.2)219 b(Keeping)46 b(C)f(data)h(str)o
(uctur)m(es)e(in)h(the)h(Scheme)f(heap)124 b(.)91 b(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)158 b(82)1023 6855 y(7.9.3)219 b(C)45
b(code)h(and)f(heap)h(images)85 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(83)605 7085 y(7.10)100 b(Using)46 b(Scheme)f(r)m(ecor)m(ds)g(in)g(C)g
(code)i(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(83)605 7315
y(7.11)100 b(Raising)46 b(exceptions)f(fr)m(om)g(external)g(code)121
b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)h(.)158 b(84)605 7545 y(7.12)100 b(Unsafe)45
b(functions)g(and)g(macr)m(os)155 b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(85)332 7960 y Fq(8)182 b(Access)45 b(to)g(POSIX)5012
b(87)605 8190 y Ft(8.1)191 b(Pr)m(ocess)45 b(primitives)64
b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(87)1023 8421 y(8.1.1)219 b(Pr)m(ocess)45 b(cr)m(eation)g(and)g
(termination)93 b(.)e(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)h(.)158 b(87)1023 8651 y(8.1.2)219
b Fp(Exec)109 b Ft(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h
(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)h(.)158 b(88)605 8881 y(8.2)191 b(Signals)142
b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)h(.)158 b(89)1023 9111 y(8.2.1)219 b(POSIX)46
b(signals)93 b(.)e(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(89)1023 9341 y(8.2.2)219 b(Other)45 b(signals)157 b(.)91
b(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h
(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(90)1023
9571 y(8.2.3)219 b(Sending)46 b(signals)100 b(.)92 b(.)f(.)g(.)h(.)f(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)h(.)158 b(91)1023 9802 y(8.2.4)219
b(Receiving)45 b(signals)105 b(.)91 b(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
h(.)158 b(91)605 10032 y(8.3)191 b(Pr)m(ocess)45 b(envir)m(onment)128
b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(91)1023 10262 y(8.3.1)219 b(Pr)m(ocess)45 b(identi\002cation)59
b(.)92 b(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(92)1023 10492
y(8.3.2)219 b(Envir)m(onment)44 b(variables)77 b(.)91
b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(92)605 10722 y(8.4)191
b(Users)46 b(and)f(gr)m(oups)118 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)h(.)158 b(92)605 10953 y(8.5)191
b(OS)46 b(and)f(machine)f(identi\002cation)57 b(.)91
b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)g(.)h(.)f(.)h(.)158 b(93)605 11183 y(8.6)191
b(Files)46 b(and)f(dir)m(ectories)55 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f
(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)h(.)158 b(93)1023 11413 y(8.6.1)219
b(Dir)m(ectory)45 b(str)m(eams)72 b(.)91 b(.)g(.)h(.)f(.)h(.)f(.)g(.)h
(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
f(.)h(.)158 b(93)1023 11643 y(8.6.2)219 b(W)-17 b(orking)45
b(dir)m(ectory)162 b(.)91 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g
(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)158
b(94)3674 12141 y(vi)p eop end
%%Page: 7 7
TeXDict begin 7 6 bop 857 1146 a Ft(8.6.3)219 b(File)45
b(cr)m(eation)g(and)g(r)m(emoval)137 b(.)91 b(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(94)857 1372 y(8.6.4)219 b(File)45 b(information)64
b(.)92 b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(96)857
1597 y(8.6.5)219 b(File)45 b(modes)80 b(.)92 b(.)f(.)g(.)h(.)f(.)g(.)h
(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)
g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(97)439 1823 y(8.7)191
b(T)-10 b(ime)180 b(.)91 b(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(98)439 2049
y(8.8)191 b(I/O)131 b(.)92 b(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f
(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159 b(98)439
2275 y(8.9)191 b(Regular)45 b(expr)m(essions)58 b(.)91
b(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)159
b(99)439 2501 y(8.10)100 b(C)45 b(to)h(Scheme)f(corr)m(espondence)180
b(.)91 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)
f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)68 b(100)166 2908 y Fq(A)132
b(ASCII)45 b(character)f(encoding)4163 b(102)166 3316
y(B)152 b(Bibliography)5192 b(104)166 3724 y(C)142 b(Index)5819
b(105)3482 12141 y Ft(vii)p eop end
%%Page: 8 8
TeXDict begin 8 7 bop 3621 12141 a Ft(viii)p eop end
%%Page: 1 9
TeXDict begin 1 8 bop 166 2391 a Fo(Chapter)87 b(1)166
3221 y Fr(Introduction)166 4111 y Ft(Scheme)54 b(48)g(is)g(an)f
(implementation)h(of)g(the)g(Scheme)f(pr)m(ogramming)g(language)h(as)g
(described)166 4337 y(in)70 b(the)g(Revised)1356 4271
y Fn(5)1506 4337 y Ft(Report)h(on)f(the)g(Algorithmic)g(Language)g
(Scheme)g([6)o(].)130 b(It)71 b(is)f(based)g(on)g(a)166
4563 y(compiler)49 b(and)h(interpr)m(eter)f(for)g(a)h(virtual)f(Scheme)
g(machine.)68 b(Scheme)49 b(48)g(tries)h(to)g(be)g(faithful)166
4789 y(to)71 b(the)f(Revised)1356 4723 y Fn(5)1505 4789
y Ft(Scheme)g(Report,)78 b(pr)m(oviding)69 b(neither)h(mor)m(e)g(nor)g
(less)g(in)g(the)g(initial)f(user)166 5015 y(envir)m(onment.)83
b(\(This)54 b(is)g(not)h(to)g(say)g(that)f(mor)m(e)g(isn't)g(available)
g(in)g(other)g(envir)m(onments;)59 b(see)166 5240 y(below)-17
b(.\))448 5466 y(Scheme)55 b(48)h(is)f(under)g(continual)f
(development.)87 b(Please)55 b(r)m(eport)h(bugs,)h(especially)f(in)f
(the)166 5692 y(VM,)49 b(especially)g(cor)m(e)f(dumps,)i(to)f
(scheme-48-bugs@s48.or)m(g.)63 b(Include)49 b(the)f(version)h(number)
166 5918 y(x.yy)70 b(fr)m(om)f(the)h(\224W)-17 b(elcome)70
b(to)g(Scheme)g(48)f(x.yy\224)h(gr)m(eeting)g(message)g(in)g(your)f
(bug)g(r)m(eport.)166 6144 y(It)e(is)g(a)f(goal)h(of)g(this)g(pr)m
(oject)f(to)h(pr)m(oduce)f(a)h(bullet-pr)m(oof)e(system;)78
b(we)67 b(want)f(no)h(bugs)f(and,)166 6369 y(especially)-20
b(,)47 b(no)f(crashes.)60 b(\(Ther)m(e)46 b(ar)m(e)g(a)g(few)g(known)g
(bugs,)g(listed)h(in)f(the)h Fp(doc/todo.txt)g Ft(\002le)166
6595 y(that)f(comes)f(with)g(the)h(distribution.\))448
6821 y(Send)j(mail)f(to)i(scheme-48-r)m(equest@s48.or)m(g)c(to)k(be)e
(put)h(on)g(a)f(mailing)g(list)h(for)f(announce-)166
7047 y(ments,)e(discussion,)f(bug)g(r)m(eports,)h(and)g(bug)e(\002xes.)
448 7273 y(The)56 b(name)f(`Scheme)g(48')g(commemorates)g(our)g(having)
g(written)h(the)g(original)f(version)g(in)166 7499 y(forty-eight)45
b(hours,)h(on)f(August)h(6th)f(and)h(7th,)g(1986.)3541
12141 y(1)p eop end
%%Page: 2 10
TeXDict begin 2 9 bop 332 2391 a Fo(Chapter)87 b(2)332
3221 y Fr(User)23 b(')-23 b(s)104 b(guide)332 4144 y
Ft(This)65 b(chapter)f(details)h(Scheme)f(48's)g(user)g(interface:)94
b(its)65 b(command-line)d(ar)m(guments,)69 b(com-)332
4370 y(mand)45 b(pr)m(ocessor)-13 b(,)46 b(debugger)-13
b(,)44 b(and)i(so)g(forth.)332 4967 y Fm(2.1)238 b(Command)58
b(line)h(arguments)332 5389 y Ft(A)46 b(few)f(command)f(line)h(ar)m
(guments)g(ar)m(e)g(pr)m(ocessed)g(by)h(Scheme)f(48)g(as)g(it)h(starts)
g(up.)614 5615 y Fp(scheme48)h Ft([)p Fp(-i)e Fs(image)p
Ft(])f([)p Fp(-h)h Fs(heapsize)p Ft(])e([)p Fp(-a)i Fs(ar)m(gument)g(.)
27 b(.)g(.)g Ft(])332 6036 y Fp(-i)46 b Fs(image)90 b
Ft(speci\002es)66 b(a)f(heap)h(image)f(\002le)h(to)g(r)m(esume.)116
b(This)65 b(defaults)h(to)g(a)f(heap)h(image)f(that)787
6261 y(r)o(uns)44 b(a)h(Scheme)h(command)e(pr)m(ocessor)-13
b(.)57 b(Heap)46 b(images)f(ar)m(e)g(cr)m(eated)g(by)h(the)f
Fp(,dump)h Ft(and)787 6487 y Fp(,build)109 b(commands)p
Ft(,)47 b(for)e(which)f(see)i(below)-17 b(.)332 6861
y Fp(-h)46 b Fs(heapsize)89 b Ft(speci\002es)61 b(how)g(much)f(space)h
(should)h(be)e(r)m(eserved)h(for)g(allocation.)104 b
Fs(Heapsize)60 b Ft(is)787 7087 y(in)53 b(wor)m(ds)g(\(wher)m(e)g(one)h
(wor)m(d)f(=)h(4)f(bytes\),)j(and)e(covers)f(both)h(semispaces,)i(only)
d(one)h(of)787 7313 y(which)48 b(is)h(in)g(use)f(at)i(any)f(given)f
(time)h(\(except)g(during)g(garbage)f(collection\).)67
b(Cons)49 b(cells)787 7539 y(ar)m(e)62 b(curr)m(ently)f(3)h(wor)m(ds,)
67 b(so)c(if)f(you)g(want)g(to)h(make)f(sur)m(e)g(you)g(can)g(allocate)
g(a)h(million)787 7764 y(cons)45 b(cells,)g(you)h(should)f(specify)g
Fp(-h)109 b(6000000)46 b Ft(\(actually)e(somewhat)h(mor)m(e)f(than)i
(this,)787 7990 y(to)d(account)g(for)g(the)g(initial)g(heap)g(image)g
(and)f(br)m(eathing)h(r)m(oom\).)55 b(The)43 b(default)g(heap)g(size)
787 8216 y(is)49 b(3000000)g(wor)m(ds.)69 b(The)50 b(system)g(will)f
(use)h(a)f(lar)m(ger)g(heap)h(if)f(the)h(speci\002ed)g(\(or)f
(default\))787 8442 y(size)c(is)h(less)f(than)g(the)h(size)g(of)f(the)g
(image)g(being)g(r)m(esumed.)332 8816 y Fp(-a)h Fs(ar)m(gument)e(.)27
b(.)g(.)120 b Ft(is)61 b(only)g(useful)f(with)g(images)h(built)f(using)
g Fp(,build)p Ft(.)104 b(The)61 b(ar)m(guments)f(ar)m(e)787
9042 y(passed)46 b(as)f(a)h(list)f(of)h(strings)f(to)h(the)g(pr)m
(ocedur)m(e)f(speci\002ed)h(in)f(the)h Fp(,build)g Ft(command)e(as)787
9267 y(for)h(example:)1117 9641 y Fp(>)110 b(\(define)f(\(f)h(a\))f
(\(for-each)h(display)f(a\))h(\(newline\))g(0\))1117
9867 y(>)g(,build)f(f)g(foo.image)1117 10093 y(>)h(,exit)1117
10319 y(\045)g(scheme48vm)g(-i)f(foo.image)h(-a)f(mumble)h("foo)f(x")
1117 10545 y(mumblefoo)h(x)1117 10770 y(\045)614 11191
y Ft(The)58 b(usual)f(de\002nition)h(of)g(the)g Fp(s48)g
Ft(or)g Fp(scheme48)g Ft(command)f(is)h(actually)f(a)g(shell)h(script)
332 11417 y(that)63 b(starts)g(up)g(the)g(Scheme)g(48)f(virtual)g
(machine)g(with)h(a)f Fp(-i)110 b Fs(image\002le)61 b
Ft(specifying)h(the)h(de-)332 11643 y(velopment)f(envir)m(onment)g
(heap)g(image)g(and)g(a)g Fp(-o)109 b Fs(vm-executable)61
b Ft(specifying)h(the)g(location)3707 12141 y(2)p eop
end
%%Page: 3 11
TeXDict begin 3 10 bop 166 1146 a Ft(of)49 b(the)g(virtual-machine)e
(executable)h(\(the)h(executable)f(is)i(needed)f(for)g(loading)g
(external)g(code)166 1372 y(on)63 b(some)g(versions)g(of)g(Unix;)73
b(see)63 b(section)g(7.5)h(for)e(mor)m(e)h(information\).)108
b(The)64 b(\002le)f Fp(go)g Ft(in)g(the)166 1597 y(Scheme)45
b(48)g(installation)h(sour)m(ce)f(dir)m(ectory)g(is)g(an)h(example)f
(of)g(such)g(a)g(shell)g(script.)166 2188 y Fm(2.2)238
b(Command)58 b(processor)166 2610 y Ft(When)51 b(you)g(invoke)g(the)h
(default)e(heap)i(image,)g(a)g(command)e(pr)m(ocessor)h(starts)h(r)o
(unning.)73 b(The)166 2835 y(command)45 b(pr)m(ocessor)h(acts)g(as)g
(both)g(a)g(r)m(ead-eval-print)e(loop,)j(r)m(eading)e(expr)m(essions,)i
(evaluat-)166 3061 y(ing)f(them,)g(and)g(printing)g(the)g(r)m(esults,)g
(and)g(as)g(an)g(interactive)f(debugger)h(and)g(data)g(inspector)-13
b(.)166 3287 y(See)46 b(Chapter)g(3)f(for)g(a)g(description)h(of)f(the)
h(command)e(pr)m(ocessor)-13 b(.)166 3877 y Fm(2.3)238
b(Editing)166 4299 y Ft(W)-17 b(e)112 b(r)m(ecommend)e(r)o(unning)g
(Scheme)i(48)f(under)h(GNU)f(Emacs)h(or)f(XEmacs)h(using)f(the)166
4525 y Fp(cmuscheme48)66 b Ft(command)e(package.)117
b(This)65 b(is)h(in)f(the)g(Scheme)g(48)g(distribution's)f
Fp(emacs/)166 4751 y Ft(subdir)m(ectory)75 b(and)g(is)h(included)f(in)g
(XEmacs's)g Fp(scheme)h Ft(package.)148 b(It)76 b(is)g(a)f(variant)g
(of)h(the)166 4977 y Fp(cmuscheme)63 b Ft(library)-20
b(,)65 b(which)c(comes)h(to)h(us)e(courtesy)h(of)g(Olin)g(Shivers,)k
(formerly)61 b(of)h(CMU.)166 5203 y(Y)-17 b(ou)46 b(might)f(want)g(to)h
(put)g(the)f(following)g(in)g(your)h(Emacs)e(init)i(\002le)f(\()p
Fp(.emacs)p Ft(\):)497 5543 y Fp(\(setq)109 b(scheme-program-name)i
("scheme48"\))497 5769 y(\(autoload)f('run-scheme)1588
5995 y("cmuscheme48")1588 6221 y("Run)f(an)g(inferior)h(Scheme)g
(process.")1588 6447 y(t\))166 6788 y Ft(The)43 b(Emacs)f(function)f
Fp(run-scheme)i Ft(can)f(then)h(be)f(used)g(to)h(start)g(a)f(pr)m
(ocess)h(r)o(unning)e(the)h(pr)m(o-)166 7013 y(gram)36
b Fp(scheme48)i Ft(in)f(a)f(new)h(buf)m(fer)-13 b(.)51
b(T)-17 b(o)38 b(make)f(the)g Fp(autoload)g Ft(and)g
Fp(\(require)110 b(...\))54 b Ft(forms)166 7239 y(work,)46
b(you)f(will)g(also)g(need)h(to)g(put)f(the)h(dir)m(ectory)f
(containing)g Fp(cmuscheme)h Ft(and)g(r)m(elated)f(\002les)166
7465 y(in)g(your)g(emacs)g(load-path:)497 7806 y Fp(\(setq)109
b(load-path)715 8032 y(\(append)h(load-path)g('\(")p
Fs(scheme-48-dir)m(ectory)p Fp(/emacs"\)\)\))166 8373
y Ft(Further)92 b(documentation)g(can)g(be)g(found)g(in)h(the)f
(\002les)h Fp(emacs/cmuscheme48.el)h Ft(and)166 8598
y Fp(emacs/comint.el)p Ft(.)166 9189 y Fm(2.4)238 b(Performance)166
9611 y Ft(If)72 b(you)h(want)f(to)h(generally)f(have)g(your)h(code)f(r)
o(un)g(faster)g(than)g(it)h(normally)f(would,)79 b(enter)166
9836 y Fp(inline-values)58 b Ft(mode)g(befor)m(e)e(loading)h(anything.)
92 b(Otherwise)56 b(calls)h(to)h(primitives)f(\(like)166
10062 y Fp(+)h Ft(and)g Fp(cons)p Ft(\))g(and)g(in-line)f(pr)m(ocedur)m
(es)g(\(like)g Fp(not)i Ft(and)e Fp(cadr)p Ft(\))h(won't)g(be)f
(open-coded,)62 b(and)166 10288 y(pr)m(ograms)45 b(will)g(r)o(un)f(mor)
m(e)h(slowly)-20 b(.)448 10514 y(The)40 b(system)g(doesn't)f(start)h
(in)f Fp(inline-values)h Ft(mode)g(by)f(default)f(because)h(the)g
(Scheme)166 10740 y(r)m(eport)48 b(permits)g(r)m(ede\002nitions)g(of)g
(built-in)e(pr)m(ocedur)m(es.)64 b(W)-10 b(ith)47 b(this)h(mode)g(set,)
i(such)d(r)m(ede\002ni-)166 10966 y(tions)c(don't)g(work)f(accor)m
(ding)g(to)h(the)g(r)m(eport,)h(because)e(pr)m(eviously)g(compiled)g
(calls)g(may)h(have)166 11191 y(in-lined)i(the)g(old)h(de\002nition,)g
(leaving)f(no)g(opportunity)i(to)f(call)f(the)g(new)g(de\002nition.)448
11417 y Fp(Inline-values)95 b Ft(mode)e(is)h(contr)m(olled)f(by)g(the)g
Fp(inline-values)i Ft(switch.)200 b Fp(,set)166 11643
y(inline-values)47 b Ft(and)e Fp(,unset)110 b(inline-values)46
b Ft(turn)f(it)h(on)f(and)h(of)m(f.)3541 12141 y(3)p
eop end
%%Page: 4 12
TeXDict begin 4 11 bop 332 1146 a Fm(2.5)238 b(Disassembler)332
1572 y Ft(The)46 b Fp(,dis)g Ft(command)e(prints)i(out)f(the)h
(disassembled)f(byte)g(codes)h(of)f(a)h(pr)m(ocedur)m(e.)663
1957 y Fp(>)109 b(,dis)g(cons)663 2185 y(cons)881 2413
y(0)g(\(protocol)h(2\))881 2641 y(2)f(\(pop\))881 2869
y(3)g(\(make-stored-object)i(2)e(pair\))881 3097 y(6)g(\(return\))663
3324 y(>)332 3708 y Ft(The)70 b(curr)m(ent)e(byte)h(codes)g(ar)m(e)g
(listed)h(in)f(the)g(\002le)g Fp(scheme/vm/arch.scm)p
Ft(.)130 b(A)69 b(somewhat)332 3934 y(out-of-date)45
b(description)h(of)f(them)g(can)g(be)g(found)g(in)g([5].)614
4161 y(The)50 b(command)f(ar)m(gument)f(is)i(optional;)i(if)d
(unsupplied)h(it)f(defaults)h(to)g(the)f(curr)m(ent)g(focus)332
4387 y(object)c(\()p Fp(##)p Ft(\).)614 4615 y(The)h(disassembler)f
(can)g(also)g(be)g(invoked)h(on)f(continuations)h(and)f(templates.)332
5225 y Fm(2.6)238 b(Module)59 b(system)332 5651 y Ft(This)68
b(section)g(gives)f(a)g(brief)g(description)g(of)h(modules)f(and)g(r)m
(elated)h(entities.)123 b(For)68 b(detailed)332 5877
y(information,)46 b(including)f(a)h(description)g(of)g(the)h(module)e
(con\002guration)h(language,)g(see)h(chap-)332 6103 y(ter)f(4.)614
6331 y(A)k Fs(module)g Ft(is)f(an)h(isolated)g(namespace,)g(with)g
(visibility)e(of)i(bindings)f(contr)m(olled)g(by)h(mod-)332
6556 y(ule)39 b(descriptions)i(written)e(in)h(a)f(special)h
(con\002guration)f(language.)55 b(A)40 b(module)f(may)g(be)h(instan-)
332 6782 y(tiated)62 b(as)f(a)g Fs(package)p Ft(,)k(which)60
b(is)h(an)g(envir)m(onment)f(in)h(which)f(code)i(can)f(be)g(evaluated.)
103 b(Most)332 7008 y(modules)63 b(ar)m(e)g(instantiated)h(only)g(once)
f(and)h(so)g(have)f(a)g(unique)g(package.)111 b(A)64
b Fs(structur)m(e)e Ft(is)h(a)332 7234 y(subset)44 b(of)g(the)h
(bindings)e(in)h(a)g(package.)57 b(Only)44 b(by)g(being)g(included)f
(in)h(a)g(str)o(uctur)m(e)f(can)h(a)g(bind-)332 7460
y(ing)50 b(be)f(made)g(visible)g(in)h(other)f(packages.)70
b(A)50 b(str)o(uctur)m(e)f(has)g(two)h(parts,)i(the)d(package)h(whose)
332 7685 y(bindings)h(ar)m(e)h(being)f(exported)h(and)g(the)g(set)g(of)
g(names)f(that)h(ar)m(e)g(to)g(be)f(exported.)77 b(This)52
b(set)g(of)332 7911 y(names)45 b(is)g(called)h(an)f Fs(interface)p
Ft(.)54 b(A)46 b(module)f(then)g(has)h(thr)m(ee)f(parts:)605
8295 y Fl(\017)91 b Ft(a)45 b(set)h(of)f(str)o(uctur)m(es)f(whose)i
(bindings)e(ar)m(e)h(to)h(be)g(visible)e(within)h(the)h(module)605
8678 y Fl(\017)91 b Ft(the)45 b(sour)m(ce)g(code)h(to)g(be)f(evaluated)
g(within)g(the)g(module)605 9062 y Fl(\017)91 b Ft(a)45
b(set)h(of)f(exported)h(interfaces)332 9445 y(Instantiating)g(a)g
(module)f(pr)m(oduces)g(a)h(package)g(and)f(a)h(set)g(of)f(str)o(uctur)
m(es,)g(one)h(for)f(each)g(of)h(the)332 9671 y(exported)g(interfaces.)
614 9899 y(The)52 b(following)f(example)h(uses)f Fp(define-structure)i
Ft(to)g(cr)m(eate)e(a)h(module)f(that)h(imple-)332 10124
y(ments)43 b(simple)g(cells)h(as)f(pairs,)h(instantiates)g(this)f
(module,)h(and)f(binds)g(the)h(r)m(esulting)e(str)o(uctur)m(e)332
10350 y(to)59 b Fp(cells)p Ft(.)94 b(The)58 b(syntax)g
Fp(\(export)110 b Fs(name)58 b(.)27 b(.)g(.)g Fp(\))96
b Ft(cr)m(eates)57 b(an)h(interface)f(containing)h Fs(name)f(.)27
b(.)g(.)g Ft(.)332 10576 y(The)58 b Fp(open)h Ft(clause)e(lists)h(str)o
(uctur)m(es)f(whose)h(bindings)f(ar)m(e)g(visible)g(within)h(the)g
(module.)94 b(The)332 10802 y Fp(begin)46 b Ft(clause)f(contains)g
(sour)m(ce)g(code.)663 11187 y Fp(\(define-structure)110
b(cells)g(\(export)g(make-cell)4154 11415 y(cell-ref)4154
11643 y(cell-set!\))3707 12141 y Ft(4)p eop end
%%Page: 5 13
TeXDict begin 5 12 bop 715 1146 a Fp(\(open)109 b(scheme\))715
1372 y(\(begin)h(\(define)f(\(make-cell)h(x\))1697 1597
y(\(cons)f('cell)h(x\)\))1479 1823 y(\(define)f(cell-ref)h(cdr\))1479
2049 y(\(define)f(cell-set!)h(set-cdr!\)\)\))448 2424
y Ft(Cells)45 b(could)f(also)h(have)f(been)g(implemented)g(using)h(the)
f(r)m(ecor)m(d)g(facility)g(described)g(in)h(sec-)166
2650 y(tion)h(5.10)f(and)h(available)e(in)h(str)o(uctur)m(e)f
Fp(define-record-type)p Ft(.)497 3025 y Fp(\(define-structure)110
b(cells)g(\(export)g(make-cell)3988 3251 y(cell-ref)3988
3477 y(cell-set!\))715 3703 y(\(open)f(scheme)h(define-record-types\))
715 3929 y(\(begin)g(\(define-record-type)g(cell)g(:cell)1697
4155 y(\(make-cell)g(value\))1697 4380 y(cell?)1697 4606
y(\(value)f(cell-ref)h(cell-set!\)\)\)\))448 4981 y Ft(W)-10
b(ith)53 b(either)f(de\002nition)g(the)h(r)m(esulting)f(str)o(uctur)m
(e)f(can)h(be)g(used)g(in)g(other)h(modules)f(by)g(in-)166
5207 y(cluding)45 b Fp(cells)h Ft(in)f(an)g Fp(open)h
Ft(clause.)448 5433 y(The)36 b(command)d(interpr)m(eter)i(is)g(always)f
(operating)i(within)e(a)h(particular)f(package.)53 b(Initially)166
5659 y(this)37 b(is)f(a)g(package)h(in)f(which)g(only)g(the)h(standar)m
(d)f(Scheme)g(bindings)g(ar)m(e)g(visible.)53 b(The)37
b(bindings)166 5885 y(of)63 b(other)h(str)o(uctur)m(es)e(can)h(be)g
(made)g(visible)g(by)g(using)g(the)g Fp(,open)h Ft(command)e(described)
h(in)166 6111 y(section)46 b(3.4)f(below)-17 b(.)448
6336 y(Note)38 b(that)g(this)f(initial)g(package)h(does)g(not)g
(include)e(the)i(con\002guration)e(language.)54 b(Module)166
6562 y(code)46 b(needs)g(to)g(be)f(evaluated)g(in)h(the)f
(con\002guration)g(package,)i(which)d(can)h(be)g(done)h(by)g(using)166
6788 y(the)g Fp(,)p Ft(con\002g)f(command:)497 7163 y
Fp(>)109 b(,config)h(\(define-structure)g(cells)g(...\))497
7389 y(>)f(,open)g(cells)497 7615 y(>)g(\(make-cell)h(4\))497
7841 y('\(cell)f(.)h(4\))497 8067 y(>)f(\(define)h(c)f(\(make-cell)h
(4\)\))497 8292 y(>)f(\(cell-ref)h(c\))497 8518 y(4)166
9116 y Fm(2.7)238 b(Library)166 9538 y Ft(A)64 b(number)f(of)h(useful)e
(utilities)i(ar)m(e)g(either)g(built)f(in)h(to)g(Scheme)g(48)g(or)g
(can)f(be)h(loaded)g(fr)m(om)166 9763 y(an)52 b(external)h(library)-20
b(.)76 b(These)53 b(utilities)g(ar)m(e)f(not)h(visible)f(in)g(the)g
(user)h(envir)m(onment)e(by)h(default,)166 9989 y(but)47
b(can)g(be)h(made)f(available)f(with)i(the)f Fp(open)h
Ft(command.)63 b(For)48 b(example,)g(to)g(use)g(the)f
Fp(tables)166 10215 y Ft(str)o(uctur)m(e,)e(do)497 10590
y Fp(>)109 b(,open)g(tables)497 10816 y(>)448 11191 y
Ft(If)49 b(the)h(utility)f(is)g(not)g(alr)m(eady)g(loaded,)i(then)e
(the)h Fp(,open)f Ft(command)f(will)h(load)g(it.)68 b(Or)-13
b(,)50 b(you)166 11417 y(can)67 b(load)h(something)f(explicitly)h
(\(without)e(opening)i(it\))g(using)f(the)g Fp(load-package)i
Ft(com-)166 11643 y(mand:)3541 12141 y(5)p eop end
%%Page: 6 14
TeXDict begin 6 13 bop 663 1146 a Fp(>)109 b(,load-package)h(queues)663
1372 y(>)f(,open)h(queues)614 1747 y Ft(When)68 b(loading)h(a)f
(utility)-20 b(,)75 b(the)69 b(message)f(\224Note:)104
b(optional)69 b(optimizer)g(not)g(invoked\224)f(is)332
1973 y(innocuous.)56 b(Feel)46 b(fr)m(ee)e(to)i(ignor)m(e)g(it.)614
2198 y(See)g(also)g(the)g(package)f(system)h(documentation,)f(in)h
(chapter)f(4.)614 2424 y(Not)122 b(all)e(of)h(the)g(the)g(libraries)f
(available)f(in)i(Scheme)f(48)h(ar)m(e)f(described)g(in)h(this)332
2650 y(manual.)297 b(All)126 b(ar)m(e)f(listed)i(in)e(\002les)h
Fp(rts-packages.scm)p Ft(,)148 b Fp(comp-packages.scm)p
Ft(,)332 2876 y Fp(env-packages.scm)p Ft(,)95 b(and)83
b Fp(more-packages.scm)i Ft(in)f(the)f Fp(scheme)h Ft(dir)m(ectory)g
(of)f(the)332 3102 y(distribution,)115 b(and)100 b(the)h(bindings)f
(they)h(export)g(ar)m(e)f(listed)h(in)f Fp(interfaces.scm)i
Ft(and)332 3328 y Fp(more-interfaces.scm)47 b Ft(in)e(the)h(same)f(dir)
m(ectory)-20 b(.)3707 12141 y(6)p eop end
%%Page: 7 15
TeXDict begin 7 14 bop 166 2425 a Fo(Chapter)87 b(3)166
3289 y Fr(Command)104 b(processor)166 4242 y Ft(This)41
b(chapter)f(details)g(Scheme)g(48's)g(command)f(pr)m(ocessor)-13
b(,)41 b(which)e(incorporates)i(both)f(a)g(r)m(ead-)166
4468 y(eval-print)55 b(loop)i(and)f(an)f(interactive)h(debugger)-13
b(.)87 b(At)56 b(the)g Fp(>)g Ft(pr)m(ompt,)j(you)d(can)g(type)g
(either)g(a)166 4694 y(Scheme)j(form)f(\(expr)m(ession)h(or)g
(de\002nition\))g(or)g(a)g(command)f(beginning)g(with)h(a)g(comma.)97
b(In)166 4919 y(inspection)53 b(mode)f(\(see)g(section)h(3.7\))f(the)g
(pr)m(ompt)h(changes)f(to)h Fp(:)70 b Ft(and)52 b(commands)g(no)g
(longer)166 5145 y(need)47 b(to)h(be)e(pr)m(eceded)h(by)g(a)g(comma;)g
(input)g(beginning)f(with)g(a)h(letter)h(or)f(digit)g(is)g(assumed)f
(to)166 5371 y(be)h(a)g(command,)g(not)g(an)g(expr)m(ession.)62
b(In)47 b(inspection)g(mode)g(the)h(command)e(pr)m(ocessor)h(prints)166
5597 y(out)f(a)f(menu)g(of)g(selectable)g(components)h(for)f(the)g
(curr)m(ent)g(object)g(of)g(inter)m(est.)166 6401 y Fm(3.1)238
b(Current)59 b(focus)h(value)e(and)i Fk(##)166 6891 y
Ft(The)e(command)f(pr)m(ocessor)h(keeps)g(track)f(of)h(a)f(curr)m(ent)g
Fs(focus)g(value)p Ft(.)92 b(This)58 b(value)f(is)h(normally)166
7117 y(the)69 b(last)h(value)e(r)m(eturned)h(by)g(a)g(command.)127
b(If)70 b(a)f(command)f(r)m(eturns)g(multiple)h(values)g(the)166
7342 y(focus)j(object)h(is)g(a)g(list)h(of)f(the)g(values.)140
b(The)73 b(focus)g(value)f(is)h(not)h(changed)e(if)h(a)g(command)166
7568 y(r)m(eturns)64 b(no)g(values)g(or)h(a)f(distinguished)h
(`unspeci\002c')d(value.)114 b(Examples)64 b(of)g(forms)g(that)h(r)m
(e-)166 7794 y(turn)51 b(this)h(unspeci\002c)f(value)f(ar)m(e)h
(de\002nitions,)j(uses)e(of)f Fp(set!)p Ft(,)j(and)d
Fp(\(if)110 b(#f)f(0\))p Ft(.)75 b(It)52 b(prints)g(as)166
8020 y Fp(#)p Fl(f)p Fp(Unspecific)p Fl(g)p Ft(.)448
8279 y(The)h(r)m(eader)f(used)h(by)f(the)h(command)e(pr)m(ocessor)i(r)m
(eads)f Fp(##)h Ft(as)f(a)h(special)f(expr)m(ession)h(that)166
8505 y(evaluates)45 b(to)h(the)g(curr)m(ent)e(focus)h(object.)497
9049 y Fp(>)109 b(\(list)g('a)h('b\))497 9308 y('\(a)f(b\))497
9567 y(>)g(\(car)g(##\))497 9827 y('a)497 10086 y(>)g(\(symbol->string)
h(##\))497 10346 y("a")497 10605 y(>)f(\(if)g(#f)h(0\))497
10865 y(#)p Fl(f)p Fp(Unspecific)p Fl(g)497 11124 y Fp(>)f(##)497
11384 y("a")497 11643 y(>)3541 12141 y Ft(7)p eop end
%%Page: 8 16
TeXDict begin 8 15 bop 332 1146 a Fm(3.2)238 b(Command)58
b(levels)332 1568 y Ft(If)j(an)g(err)m(or)-13 b(,)65
b(keyboar)m(d)c(interr)o(upt,)66 b(or)61 b(other)h(br)m(eakpoint)f
(occurs,)k(or)d(the)f Fp(,push)h Ft(command)332 1793
y(is)48 b(used,)g(the)g(command)f(pr)m(ocessor)g(invokes)h(a)f(r)m
(ecursive)g(copy)h(of)f(itself,)i(pr)m(eserving)e(the)g(dy-)332
2019 y(namic)60 b(state)h(of)g(the)g(pr)m(ogram)f(when)g(the)h(br)m
(eakpoint)g(occur)m(ed.)102 b(The)61 b(r)m(ecursive)e(invocation)332
2245 y(cr)m(eates)49 b(a)h(new)f Fs(command)h(level)p
Ft(.)67 b(The)50 b(command)e(levels)i(form)e(a)i(stack)f(with)g(the)h
(curr)m(ent)e(level)332 2471 y(at)58 b(the)g(top.)94
b(The)58 b(command)e(pr)m(ompt)i(indicates)f(the)h(number)e(of)i
(stopped)g(levels)g(below)f(the)332 2697 y(curr)m(ent)64
b(one:)95 b Fp(>)64 b Ft(or)h Fp(:)94 b Ft(for)65 b(the)f(base)g(level)
h(and)f Fs(n)p Fp(>)h Ft(or)f Fs(n)p Fp(:)95 b Ft(for)64
b(all)g(other)h(levels,)70 b(wher)m(e)63 b Fs(n)i Ft(is)332
2923 y(the)45 b(command-level)e(nesting)i(depth.)58 b(The)45
b Fp(auto-levels)h Ft(switch)e(described)h(below)f(can)g(be)332
3148 y(used)h(to)h(disable)f(the)h(automatic)f(pushing)g(of)g(new)g
(levels.)614 3374 y(The)179 b(command)e(pr)m(ocessor)13
b('s)179 b(evaluation)f(package)g(and)h(the)f(value)g(of)g(the)332
3600 y Fp(inspect-focus-value)119 b Ft(switch)d(ar)m(e)g(local)h(to)g
(each)f(command)g(level.)270 b(They)118 b(ar)m(e)332
3826 y(pr)m(eserved)43 b(when)g(a)h(new)f(level)g(is)g(pushed)h(and)f
(r)m(estor)m(ed)h(when)f(it)g(is)h(discar)m(ded.)56 b(The)43
b(settings)332 4052 y(of)i(all)h(other)f(switches)g(ar)m(e)g(shar)m(ed)
g(by)g(all)h(command)e(levels.)423 4392 y Fl(h)p Ft(eof)p
Fl(i)787 4618 y Ft(Discar)m(ds)f(the)h(curr)m(ent)f(command)g(level)h
(and)g(r)m(esumes)f(r)o(unning)g(the)h(level)g(down.)56
b Fl(h)p Ft(eof)p Fl(i)787 4844 y Ft(is)87 b(usually)g(contr)m(ol-)p
Fp(D)h Ft(at)g(a)f(Unix)h(shell)g(or)g(contr)m(ol-)p
Fp(C)f Ft(contr)m(ol-)p Fp(D)g Ft(using)h(the)g(Emacs)787
5070 y Fp(cmuscheme48)46 b Ft(library)-20 b(.)423 5417
y Fp(,pop)787 5643 y Ft(The)45 b(same)h(as)f Fl(h)p Ft(eof)p
Fl(i)p Ft(.)423 5990 y Fp(,proceed)110 b([)p Fs(exp)f
Fp(...)p Ft(])787 6216 y(Pr)m(oceed)70 b(after)g(an)g(interr)o(upt)g
(or)h(err)m(or)-13 b(,)76 b(r)m(esuming)70 b(the)g(next)h(command)f
(level)g(down,)787 6442 y(delivering)46 b(the)h(values)g(of)f
Fs(exp)h(.)27 b(.)g(.)90 b Ft(to)48 b(the)f(continuation.)61
b(Interr)o(upt)47 b(continuations)f(dis-)787 6667 y(car)m(d)62
b(any)h(r)m(eturned)f(values.)108 b Fp(,Pop)64 b Ft(and)e
Fp(,proceed)i Ft(have)e(the)h(same)g(ef)m(fect)f(after)g(an)787
6893 y(interr)o(upt)57 b(but)h(behave)f(dif)m(fer)m(ently)g(after)h
(err)m(ors.)95 b Fp(,Proceed)59 b Ft(r)m(estarts)f(the)g(err)m(oneous)
787 7119 y(computation)64 b(fr)m(om)f(the)i(point)g(wher)m(e)f(the)g
(err)m(or)g(occurr)m(ed)g(\(although)f(not)i(all)f(err)m(ors)787
7345 y(ar)m(e)42 b(pr)m(oceedable\))g(while)h Fp(,pop)g
Ft(\(and)f Fl(h)p Ft(eof)p Fl(i)p Ft(\))g(discar)m(ds)h(it)g(and)g(pr)m
(ompts)g(for)g(a)f(new)h(com-)787 7571 y(mand.)423 7918
y Fp(,push)787 8144 y Ft(Pushes)66 b(a)h(new)g(command)f(level)h(on)g
(above)g(the)g(curr)m(ent)f(one.)122 b(This)67 b(is)g(useful)f(if)h
(the)787 8370 y Fp(auto-levels)61 b Ft(switch)f(has)h(been)f(used)g(to)
h(disable)f(the)h(automatic)f(pushing)g(of)h(new)787
8595 y(levels)45 b(for)g(err)m(ors)g(and)g(interr)o(upts.)423
8943 y Fp(,reset)110 b([)p Fs(number)p Fp(])787 9168
y Ft(Pops)71 b(down)h(to)f(a)h(given)f(level)g(and)g(r)m(estarts)g
(that)h(level.)134 b Fs(Number)72 b Ft(defaults)f(to)h(zer)m(o,)787
9394 y Fp(,reset)46 b Ft(r)m(estarts)f(the)h(command)e(pr)m(ocessor)-13
b(,)46 b(discar)m(ding)e(all)i(existing)f(levels.)614
9735 y(Whenever)75 b(moving)f(to)h(an)g(existing)g(level,)83
b(either)74 b(by)h(sending)g(an)g Fl(h)p Ft(eof)p Fl(i)f
Ft(or)h(by)g(using)332 9961 y Fp(,reset)53 b Ft(or)g(the)f(other)h
(commands)e(listed)i(above,)h(the)f(command)e(pr)m(ocessor)i(r)o(uns)e
(all)i(of)f(the)332 10187 y Fp(dynamic-wind)e Ft(\223after)13
b(\224)48 b(thunks)h(belonging)f(to)h(stopped)h(computations)f(on)g
(the)g(discar)m(ded)332 10412 y(level\(s\).)332 10995
y Fm(3.3)238 b(Logistical)58 b(commands)423 11417 y Fp(,load)110
b Fs(\002lename)44 b(.)27 b(.)g(.)787 11643 y Ft(Loads)48
b(the)g(named)f(Scheme)h(sour)m(ce)f(\002le\(s\).)63
b(Easier)48 b(to)h(type)f(than)g Fp(\(load)110 b(")p
Fs(\002lename)p Fp("\))3707 12141 y Ft(8)p eop end
%%Page: 9 17
TeXDict begin 9 16 bop 621 1146 a Ft(because)50 b(you)i(don't)g(have)f
(to)h(shift)f(to)h(type)h(the)f(par)m(entheses)f(or)h(quote)g(marks.)75
b(\(How-)621 1372 y(ever)-13 b(,)41 b(it)g(is)g(still)g(possible)g(to)h
(specify)e(a)h(\002lename)f(as)h(a)g(Scheme)f(string)h(literal,)h(with)
f(quote)621 1597 y(marks\227you'll)46 b(need)i(this)g(for)g
(\002lenames)f(containing)h(whitespace.\))64 b(Also,)49
b(it)f(works)g(in)621 1823 y(any)60 b(package,)66 b(unlike)60
b Fp(\(load)110 b(")p Fs(\002lename)p Fp("\))p Ft(,)65
b(which)60 b(will)g(work)h(only)g(work)g(in)f(pack-)621
2049 y(ages)45 b(in)g(which)g(the)g(variable)g Fp(load)g
Ft(is)h(de\002ned)g(appr)m(opriately)-20 b(.)257 2410
y Fp(,exit)109 b([)p Fs(exp)p Fp(])40 b Ft(Exits)g(back)f(out)h(to)g
(shell)g(\(or)f(executive)g(or)h(whatever)f(invoked)h(Scheme)g(48)f(in)
621 2636 y(the)47 b(\002rst)h(place\).)63 b Fs(Exp)47
b Ft(should)g(evaluate)h(to)g(an)f(integer)-13 b(.)63
b(The)48 b(integer)f(is)h(r)m(eturned)f(to)h(the)621
2862 y(calling)56 b(pr)m(ogram.)90 b(The)57 b(default)g(value)f(of)g
Fs(exp)h Ft(is)f(zer)m(o,)k(which,)f(on)e(Unix,)j(is)d(generally)621
3088 y(interpr)m(eted)45 b(as)h(success.)166 3678 y Fm(3.4)238
b(Module)59 b(commands)166 4100 y Ft(Ther)m(e)49 b(ar)m(e)f(many)g
(commands)g(r)m(elated)h(to)g(modules.)67 b(Only)48 b(the)h(most)g
(commonly)f(used)h(mod-)166 4325 y(ule)66 b(commands)f(ar)m(e)h
(described)g(her)m(e;)76 b(documentation)66 b(for)g(the)g(r)m(est)h
(can)e(be)h(found)g(in)g(sec-)166 4551 y(tion)73 b(4.8.)137
b(Ther)m(e)72 b(is)g(also)h(a)f(brief)f(description)i(of)f(modules,)79
b(str)o(uctur)m(es,)f(and)72 b(packages)g(in)166 4777
y(section)46 b(2.6)f(below)-17 b(.)257 5160 y Fp(,open)109
b Fs(structur)m(e)44 b(.)27 b(.)g(.)621 5386 y Ft(Makes)37
b(the)h(bindings)e(in)h(the)h Fs(structur)m(e)p Ft(s)d(visible)h(in)h
(the)h(curr)m(ent)e(package.)54 b(The)38 b(packages)621
5611 y(associated)61 b(with)h(the)f Fs(structur)m(e)p
Ft(s)f(will)h(be)g(loaded)h(if)f(this)g(has)h(not)g(alr)m(eady)f(been)g
(done)621 5837 y(\(the)54 b Fp(ask-before-loading)i Ft(switch)e(can)f
(be)h(used)h(disable)f(the)g(automatic)g(loading)621
6063 y(of)45 b(packages\).)257 6424 y Fp(,config)110
b([)p Fs(command)p Fp(])621 6650 y Ft(Executes)48 b Fs(command)g
Ft(in)g(the)h Fp(config)g Ft(package,)g(which)e(includes)h(the)g
(module)g(con\002gu-)621 6876 y(ration)d(language.)56
b(For)46 b(example,)f(use)951 7237 y Fp(,config)110 b(,load)g
Fs(\002lename)621 7598 y Ft(to)44 b(load)g(a)f(\002le)h(containing)f
(module)h(de\002nitions.)56 b(If)44 b(no)g Fs(command)g
Ft(is)f(given,)i(the)e Fp(config)621 7824 y Ft(package)i(becomes)g(the)
h(execution)f(package)g(for)g(futur)m(e)f(commands.)257
8185 y Fp(,user)109 b([)p Fs(command)p Fp(])621 8411
y Ft(This)52 b(is)h(similar)f(to)h(the)g Fp(,config)p
Ft(.)79 b(It)53 b(moves)f(to)h(or)g(executes)f(a)h(command)e(in)i(the)f
(user)621 8637 y(package)43 b(\(which)e(is)i(the)g(default)f(package)h
(when)g(the)g(Scheme)f(48)h(command)f(pr)m(ocessor)621
8863 y(starts\).)166 9453 y Fm(3.5)238 b(Debugging)59
b(commands)257 9875 y Fp(,preview)621 10100 y Ft(Somewhat)e(like)g(a)f
(backtrace,)k(but)c(because)g(of)h(tail)g(r)m(ecursion)f(you)h(see)g
(less)g(than)g(you)621 10326 y(might)47 b(in)h(debuggers)f(for)h(some)g
(other)g(languages.)64 b(The)48 b(stack)g(to)g(display)g(is)g(chosen)g
(as)621 10552 y(follows:)793 10913 y(1.)92 b(If)47 b(the)h(curr)m(ent)f
(focus)g(object)g(is)h(a)f(continuation)h(or)f(a)h(thr)m(ead,)g(then)g
(that)g(continua-)1021 11139 y(tion)d(or)h(thr)m(ead's)f(stack)g(is)h
(displayed.)793 11417 y(2.)92 b(Otherwise,)54 b(if)e(the)h(curr)m(ent)e
(command)h(level)g(was)g(initiated)h(because)e(of)i(a)f(br)m(eak-)1021
11643 y(point)45 b(in)f(the)g(next)h(level)f(down,)h(then)f(the)h
(stack)f(at)h(that)g(br)m(eakpoint)f(is)g(displayed.)3541
12141 y(9)p eop end
%%Page: 10 18
TeXDict begin 10 17 bop 959 1146 a Ft(3.)92 b(Otherwise,)76
b(ther)m(e)70 b(is)g(no)g(stack)h(to)f(display)h(and)f(a)g(message)g
(is)g(printed)g(to)h(that)1187 1372 y(ef)m(fect.)787
1728 y(One)39 b(line)g(is)g(printed)h(out)g(for)f(each)g(continuation)g
(on)g(the)h(chosen)f(stack,)i(going)f(fr)m(om)e(top)787
1953 y(to)46 b(bottom.)423 2310 y Fp(,run)109 b Fs(exp)787
2535 y Ft(Evaluate)65 b Fs(exp)p Ft(,)72 b(printing)66
b(the)g(r)m(esult\(s\))f(and)h(making)g(them)g(\(or)g(a)g(list)g(of)g
(them,)72 b(if)66 b Fs(exp)787 2761 y Ft(r)m(eturns)i(multiple)g(r)m
(esults\))g(the)h(new)f(focus)g(object.)126 b(The)70
b Fp(,run)f Ft(command)e(is)i(useful)787 2987 y(when)44
b(writing)h(command)g(pr)m(ograms,)g(which)g(ar)m(e)g(described)f(in)i
(section)f(3.8)h(below)-17 b(.)423 3343 y Fp(,trace)110
b Fs(name)f Fp(...)787 3569 y Ft(Start)60 b(tracing)e(calls)h(to)h(the)
f(named)g(pr)m(ocedur)m(e)f(or)h(pr)m(ocedur)m(es.)97
b(W)-10 b(ith)59 b(no)h(ar)m(guments,)787 3795 y(displays)i(all)f(pr)m
(ocedur)m(es)h(curr)m(ently)f(traced.)106 b(This)62 b(af)m(fects)e(the)
j(binding)e(of)g Fs(name)p Ft(,)67 b(not)787 4021 y(the)k(behavior)g
(of)g(the)h(pr)m(ocedur)m(e)f(that)g(is)h(its)f(curr)m(ent)g(value.)134
b Fs(Name)72 b Ft(is)f(r)m(ede\002ned)h(to)787 4246 y(be)d(a)h(pr)m
(ocedur)m(e)g(that)g(prints)g(a)h(message,)76 b(calls)70
b(the)g(original)g(value)f(of)h Fs(name)p Ft(,)77 b(prints)787
4472 y(another)52 b(message,)i(and)d(\002nally)h(passes)h(along)f(the)g
(value\(s\))e(r)m(eturned)i(by)f(the)h(original)787 4698
y(pr)m(ocedur)m(e.)423 5054 y Fp(,untrace)110 b Fs(name)f
Fp(...)787 5280 y Ft(Stop)67 b(tracing)f(calls)f(to)i(the)f(named)g(pr)
m(ocedur)m(e)f(or)h(pr)m(ocedur)m(es.)119 b(W)-10 b(ith)66
b(no)g(ar)m(gument,)787 5506 y(stop)46 b(tracing)f(all)g(calls)g(to)h
(all)f(pr)m(ocedur)m(es.)423 5862 y Fp(,condition)787
6088 y Ft(The)59 b Fp(,condition)g Ft(command)f(displays)h(the)g
(condition)g(object)f(describing)g(the)h(err)m(or)787
6314 y(or)c(interr)o(upt)g(that)h(initiated)f(the)h(curr)m(ent)e
(command)g(level.)87 b(The)56 b(condition)f(object)g(be-)787
6539 y(comes)63 b(the)g(curr)m(ent)f(focus)g(value.)110
b(This)63 b(is)g(particularly)g(useful)f(in)g(conjunction)g(with)787
6765 y(the)48 b(inspector)-13 b(.)65 b(For)49 b(example,)g(if)f(a)g(pr)
m(ocedur)m(e)g(is)g(passed)h(the)g(wr)m(ong)e(number)g(of)h(ar)m(gu-)
787 6991 y(ments,)42 b(do)g Fp(,condition)h Ft(followed)e(by)g
Fp(,inspect)i Ft(to)f(inspect)g(the)f(pr)m(ocedur)m(e)g(and)h(its)787
7217 y(ar)m(guments.)423 7573 y Fp(,bound?)110 b Fs(name)787
7799 y Ft(Display)45 b(the)h(binding)e(of)i Fs(name)p
Ft(,)f(if)g(ther)m(e)h(is)f(one,)h(and)f(otherwise)h(prints)f(`)p
Fp(Not)109 b(bound)p Ft('.)423 8155 y Fp(,expand)h Fs(form)423
8329 y Fp(,expand-all)g Fs(form)787 8555 y Ft(Show)41
b(macr)m(o)f(expansion)i(of)f Fs(form)p Ft(,)h(if)e(any)-20
b(.)55 b Fp(,expand)42 b Ft(performs)f(a)g(single)g(macr)m(o)g(expan-)
787 8781 y(sion)k(while)g Fp(,expand-all)h Ft(fully)f(expands)h(all)f
(macr)m(os)f(in)h Fs(form)p Ft(.)423 9137 y Fp(,where)110
b Fs(pr)m(ocedur)m(e)787 9363 y Ft(Display)45 b(name)g(of)g(\002le)h
(containing)f Fs(pr)m(ocedur)m(e)p Ft('s)e(sour)m(ce)h(code.)332
9950 y Fm(3.6)238 b(Switches)332 10372 y Ft(Ther)m(e)45
b(ar)m(e)g(a)f(number)g(of)h(binary)f(switches)g(that)i(contr)m(ol)e
(the)i(behavior)e(of)g(the)i(command)d(pr)m(o-)332 10598
y(cessor)-13 b(.)57 b(They)45 b(can)g(be)g(set)h(using)f(the)h
Fp(,set)g Ft(and)f Fp(,unset)h Ft(commands.)423 10966
y Fp(,set)109 b Fs(switch)g Fp([on)g(|)g(off)g(|)h(?])787
11191 y Ft(This)48 b(sets)h(the)f(value)f(of)h(mode-switch)f
Fs(switch)p Ft(.)64 b(The)49 b(second)f(ar)m(gument)f(defaults)h(to)g
Fp(on)p Ft(.)787 11417 y(If)g(the)g(second)h(ar)m(gument)e(is)h
Fp(?)65 b Ft(the)49 b(value)e(of)i Fs(switch)e Ft(is)h(is)g(displayed)h
(and)f(not)h(changed.)787 11643 y(Doing)c Fp(,set)109
b(?)57 b Ft(will)45 b(display)g(a)h(list)f(of)h(the)f(switches)g(and)h
(their)f(curr)m(ent)f(values.)3661 12141 y(10)p eop end
%%Page: 11 19
TeXDict begin 11 18 bop 257 1146 a Fp(,unset)110 b Fs(switch)621
1372 y Fp(,unset)f Fs(switch)45 b Ft(is)g(the)h(same)f(as)g
Fp(,set)110 b Fs(switch)e Fp(off)p Ft(.)448 1843 y(The)46
b(switches)f(ar)m(e)g(as)h(follows:)257 2256 y Fp(batch)621
2481 y Ft(In)39 b(`batch)e(mode')i(any)g(err)m(or)f(or)h(interr)o(upt)g
(that)g(comes)f(up)h(will)g(cause)f(Scheme)h(48)f(to)i(exit)621
2707 y(immediately)51 b(with)g(a)h(non-zer)m(o)f(exit)g(status.)76
b(Also,)55 b(the)c(command)g(pr)m(ocessor)h(doesn't)621
2933 y(print)45 b(pr)m(ompts.)57 b(Batch)45 b(mode)h(is)f(of)m(f)g(by)g
(default.)257 3345 y Fp(auto-levels)621 3571 y Ft(Enables)65
b(or)g(disables)h(the)g(automatic)f(pushing)g(of)h(a)f(new)g(command)g
(level)g(when)g(an)621 3797 y(err)m(or)-13 b(,)51 b(interr)o(upt,)i(or)
e(other)g(br)m(eakpoint)g(occurs.)72 b(When)51 b(enabled)f(\(the)h
(default\),)g(br)m(eak-)621 4023 y(points)d(push)f(a)g(new)g(command)f
(level,)i(and)f Fl(h)p Ft(eof)p Fl(i)g Ft(\(see)g(above\))g(or)g
Fp(,reset)h Ft(is)f(r)m(equir)m(ed)621 4249 y(to)f(r)m(eturn)e(to)i
(top)g(level.)57 b(The)46 b(ef)m(fects)e(of)i(pushed)f(command)f
(levels)i(include:)839 4661 y Fl(\017)91 b Ft(a)45 b(longer)g(pr)m
(ompt)839 4972 y Fl(\017)91 b Ft(r)m(etention)45 b(of)g(the)h
(continuation)f(in)g(ef)m(fect)g(at)g(the)h(point)g(of)f(err)m(ors)839
5283 y Fl(\017)91 b Ft(confusion)44 b(among)h(some)h(newcomers)621
5695 y(W)-10 b(ith)60 b Fp(auto-levels)i Ft(disabled)f(one)g(must)f
(issue)h(a)g Fp(,push)g Ft(command)f(immediately)621
5921 y(following)55 b(an)h(err)m(or)f(in)h(or)m(der)g(to)g(r)m(etain)g
(the)g(err)m(or)f(continuation)h(for)g(debugging)f(pur)m(-)621
6147 y(poses;)j(otherwise)53 b(the)h(continuation)f(is)g(lost)h(as)f
(soon)h(as)f(the)h(focus)f(object)f(changes.)80 b(If)621
6373 y(you)39 b(don't)g(know)g(anything)h(about)f(the)g(available)f
(debugging)h(tools,)j(then)d(levels)g(might)621 6599
y(as)45 b(well)g(be)g(disabled.)257 7011 y Fp(inspect-focus-value)621
7237 y Ft(Enable)38 b(or)h(disable)g(`inspection')g(mode,)i(which)d(is)
h(used)g(for)g(inspecting)g(data)g(str)o(uctur)m(es)621
7463 y(and)45 b(continuations.)56 b(Inspection)46 b(mode)g(is)f
(described)g(in)g(section)h(3.7.)257 7875 y Fp(break-on-warnings)621
8101 y Ft(Enter)g(a)g(new)g(command)f(level)h(when)g(a)g(warning)f(is)h
(pr)m(oduced,)h(just)f(as)g(when)g(an)f(err)m(or)621
8327 y(occurs.)55 b(Normally)42 b(warnings)g(only)h(r)m(esult)f(in)h(a)
g(displayed)g(message)g(and)g(the)g(pr)m(ogram)621 8553
y(does)j(not)f(stop)i(executing.)257 8965 y Fp(ask-before-loading)621
9191 y Ft(If)74 b(on,)82 b(the)74 b(system)g(will)g(ask)g(befor)m(e)g
(loading)g(modules)g(that)g(ar)m(e)g(ar)m(guments)f(to)i(the)621
9417 y Fp(,open)45 b Ft(command.)56 b Fp(Ask-before-loading)47
b Ft(is)f(of)m(f)e(by)h(default.)951 9838 y Fp(>)109
b(,set)h(ask-before-loading)951 10074 y(will)g(ask)f(before)h(loading)f
(modules)951 10309 y(>)g(,open)h(random)951 10544 y(Load)g(structure)g
(random)f(\(y/n\)?)h(y)951 10779 y(>)257 11191 y(load-noisily)621
11417 y Ft(When)54 b(on,)k(the)d(system)h(will)e(print)h(out)h(the)f
(names)f(of)h(modules)g(and)g(\002les)g(as)g(they)g(ar)m(e)621
11643 y(loaded.)i Fp(load-noisily)46 b Ft(is)g(of)m(f)e(by)h(default.)
3495 12141 y(11)p eop end
%%Page: 12 20
TeXDict begin 12 19 bop 1117 1146 a Fp(>)110 b(,set)f(load-noisily)1117
1372 y(will)h(notify)f(when)h(loading)g(modules)f(and)h(files)1117
1597 y(>)g(,open)f(random)1117 1823 y([random)h
(/usr/local/lib/scheme48/big/random.scm])1117 2049 y(>)423
2424 y(inline-values)787 2650 y Ft(This)43 b(contr)m(ols)f(whether)h
(or)g(not)g(the)g(compiler)f(is)h(allowed)g(to)g(substitute)g
(variables')e(val-)787 2876 y(ues)53 b(in-line.)79 b(When)53
b Fp(inline-values)h Ft(mode)g(is)f(on,)j(some)d(Scheme)g(pr)m(ocedur)m
(es)g(will)787 3102 y(be)38 b(substituted)g(in-line;)j(when)d(it)g(is)h
(of)m(f,)h(none)e(will.)54 b(Section)39 b(2.4)g(has)f(mor)m(e)h
(information.)332 3699 y Fm(3.7)238 b(Inspection)59 b(mode)332
4121 y Ft(Ther)m(e)f(is)f(a)h(data)g(inspector)g(available)e(via)h(the)
h Fp(,inspect)g Ft(and)g Fp(,debug)g Ft(commands)f(or)g(by)332
4347 y(setting)45 b(the)g Fp(inspect-focus-value)h Ft(switch.)56
b(The)44 b(inspector)h(is)g(particularly)e(useful)g(with)332
4573 y(pr)m(ocedur)m(es,)52 b(continuations,)h(and)e(r)m(ecor)m(ds.)72
b(The)52 b(command)e(pr)m(ocessor)h(can)f(be)h(taken)g(out)g(of)332
4799 y(inspection)41 b(mode)f(by)g(using)f(the)i Fp(q)f
Ft(command,)h(by)f(unsetting)g(the)g Fp(inspect-focus-value)332
5024 y Ft(switch,)69 b(or)64 b(by)g(going)g(to)h(a)f(command)e(level)i
(wher)m(e)g(the)g Fp(inspect-focus-value)i Ft(is)e(not)332
5250 y(set.)125 b(When)67 b(in)h(inspection)g(mode,)74
b(input)68 b(that)g(begins)g(with)f(a)h(letter)g(or)h(digit)f(is)g(r)m
(ead)f(as)h(a)332 5476 y(command,)46 b(not)h(as)f(an)g(expr)m(ession.)
60 b(T)-17 b(o)47 b(see)g(the)f(value)g(of)g(a)g(variable)f(or)i
(number)-13 b(,)45 b(do)i Fp(\(begin)332 5702 y Fs(exp)p
Fp(\))e Ft(or)h(use)f(the)h Fp(,run)109 b Fs(exp)45 b
Ft(command.)614 5928 y(In)53 b(inspection)h(mode)f(the)g(command)f(pr)m
(ocessor)h(prints)g(out)g(a)g(menu)g(of)f(selectable)h(com-)332
6153 y(ponents)f(for)f(the)g(curr)m(ent)f(focus)h(object.)74
b(T)-17 b(o)52 b(inspect)f(a)g(particular)g(component,)i(just)e(type)h
(the)332 6379 y(corr)m(esponding)h(number)e(in)i(the)g(menu.)79
b(That)54 b(component)f(becomes)f(the)h(new)g(focus)f(object.)332
6605 y(For)46 b(example:)663 6980 y Fp(>)109 b(,inspect)h('\(a)f(\(b)g
(c\))h(d\))663 7206 y(\(a)f(\(b)g(c\))h(d\))663 7658
y([0])f(a)663 7884 y([1])g(\(b)g(c\))663 8110 y([2])g(d)663
8335 y(:)g(1)663 8561 y(\(b)g(c\))663 9013 y([0])g(b)663
9239 y([1])g(c)663 9464 y(:)614 9840 y Ft(When)50 b(a)g(new)f(focus)g
(object)h(is)g(selected)g(the)g(pr)m(evious)g(one)g(is)g(pushed)g(onto)
g(a)g(stack.)71 b(Y)-17 b(ou)332 10066 y(can)58 b(pop)h(the)g(stack,)j
(r)m(everting)c(to)h(the)g(pr)m(evious)f(object,)k(with)c(the)g
Fp(u)h Ft(command,)i(or)e(use)f(the)332 10291 y Fp(stack)46
b Ft(command)e(to)i(move)f(to)h(an)g(earlier)f(object.)614
10517 y(Commands)g(useful)f(when)h(in)g(inspection)h(mode:)605
10892 y Fl(\017)91 b Fp(u)45 b Ft(\(up\))g(pop)h(object)f(stack)605
11268 y Fl(\017)91 b Fp(m)45 b Ft(\(mor)m(e\))f(print)i(mor)m(e)f(of)g
(a)g(long)h(menu)605 11643 y Fl(\017)91 b Fp(\(...\))56
b Ft(evaluate)45 b(a)h(form)e(and)i(select)f(r)m(esult)3661
12141 y(12)p eop end
%%Page: 13 21
TeXDict begin 13 20 bop 439 1146 a Fl(\017)91 b Fp(q)45
b Ft(quit)439 1517 y Fl(\017)91 b Fp(template)58 b Ft(select)g(a)g
(closur)m(e)f(or)g(continuation's)g(template)h(\(T)-17
b(emplates)59 b(ar)m(e)e(the)h(static)621 1743 y(components)j(of)g(pr)m
(ocedur)m(es;)69 b(these)62 b(ar)m(e)f(found)g(inside)g(of)g(pr)m
(ocedur)m(es)g(and)g(continu-)621 1968 y(ations,)f(and)d(contain)f(the)
h(quoted)h(constants)f(and)f(top-level)h(variables)f(r)m(eferr)m(ed)g
(to)h(by)621 2194 y(byte-compiled)44 b(code.\))439 2565
y Fl(\017)91 b Fp(d)45 b Ft(\(down\))f(move)i(to)g(the)f(next)h
(continuation)f(\(curr)m(ent)f(object)h(must)g(be)g(a)g(continuation\))
439 2937 y Fl(\017)91 b Fp(menu)45 b Ft(print)h(the)g(selection)f(menu)
g(for)g(the)g(focus)g(object)448 3302 y(Multiple)66 b(selection)g
(commands)f(\()p Fp(u)p Ft(,)71 b Fp(d)p Ft(,)h(and)65
b(menu)g(indexes\))h(may)f(be)g(put)h(on)g(a)g(single)166
3527 y(line.)448 3753 y(All)52 b(or)m(dinary)e(commands)g(ar)m(e)g
(available)g(when)g(in)h(inspection)g(mode.)74 b(Similarly)-20
b(,)52 b(the)f(in-)166 3979 y(spection)46 b(commands)e(can)h(be)g(used)
h(when)f(not)g(in)h(inspection)f(mode.)57 b(For)46 b(example:)497
4344 y Fp(>)109 b(\(list)g('a)h('\(b)f(c\))g('d\))497
4570 y('\(a)g(\(b)g(c\))h(d\))497 4796 y(>)f(,1)497 5021
y('\(b)g(c\))497 5247 y(>)g(,menu)497 5473 y([0])g(b)497
5699 y([1])g(c)497 5925 y(>)448 6290 y Ft(If)37 b(the)g(curr)m(ent)f
(command)g(level)h(was)g(initiated)g(because)f(of)h(a)g(br)m(eakpoint)g
(in)g(the)g(next)g(level)166 6516 y(down,)55 b(then)e
Fp(,debug)g Ft(will)f(invoke)g(the)h(inspector)g(on)g(the)g
(continuation)f(at)h(the)g(point)g(of)g(the)166 6741
y(err)m(or)-13 b(.)104 b(The)62 b Fp(u)g Ft(and)g Fp(d)f
Ft(\(up)g(and)h(down\))f(commands)f(then)i(make)f(the)h
(inspected-value)f(stack)166 6967 y(look)54 b(like)f(a)g(conventional)f
(stack)h(debugger)-13 b(,)55 b(with)d(continuations)h(playing)g(the)g
(r)m(ole)g(of)g(stack)166 7193 y(frames.)58 b Fp(D)47
b Ft(goes)f(to)h(older)g(or)f(deeper)h(continuations)f(\(frames\),)f
(and)h Fp(u)g Ft(goes)h(back)f(up)g(to)h(mor)m(e)166
7419 y(r)m(ecent)e(ones.)166 8014 y Fm(3.8)238 b(Command)58
b(programs)166 8436 y Ft(The)43 b Fp(exec)h Ft(package)e(contains)h(pr)
m(ocedur)m(es)f(that)h(ar)m(e)g(used)g(to)g(execute)g(the)g(command)f
(pr)m(oces-)166 8662 y(sor)13 b('s)48 b(commands.)62
b(A)47 b(command)g Fp(,)p Fs(foo)f Ft(is)i(executed)f(by)g(applying)h
(the)f(value)g(of)g(the)h(identi\002er)166 8888 y Fs(foo)c
Ft(in)i(the)f Fp(exec)h Ft(package)g(to)g(the)f(\(suitably)g(parsed\))g
(command)f(ar)m(guments.)257 9300 y Fp(,exec)109 b([)p
Fs(command)p Fp(])621 9526 y Ft(Evaluate)45 b Fs(command)g
Ft(in)h(the)f Fp(exec)h Ft(package.)57 b(For)46 b(example,)f(use)951
9897 y Fp(,exec)110 b(,load)f Fs(\002lename)621 10268
y Ft(to)54 b(load)h(a)f(\002le)g(containing)f(commands.)82
b(If)54 b(no)g Fs(command)h Ft(is)f(given,)i(the)e Fp(exec)h
Ft(package)621 10494 y(becomes)44 b(the)i(execution)f(package)h(for)f
(futur)m(e)f(commands.)448 10907 y(The)i(r)m(equir)m(ed)e(ar)m(gument)h
(types)h(ar)m(e)f(as)g(follows:)439 11272 y Fl(\017)91
b Ft(\002lenames)44 b(should)i(be)f(strings)439 11643
y Fl(\017)91 b Ft(other)45 b(names)g(and)g(identi\002ers)h(should)f(be)
g(symbols)3495 12141 y(13)p eop end
%%Page: 14 22
TeXDict begin 14 21 bop 605 1146 a Fl(\017)91 b Ft(expr)m(essions)45
b(should)g(be)h(s-expr)m(essions)605 1542 y Fl(\017)91
b Ft(commands)g(\(as)g(for)h Fp(,config)h Ft(and)f Fp(,exec)g
Ft(itself\))g(should)g(be)f(lists)i(of)f(the)g(form)787
1768 y Fp(\()p Fs(command-name)109 b(ar)m(gument)f(...)p
Fp(\))58 b Ft(wher)m(e)44 b Fs(command-name)i Ft(is)f(a)g(symbol.)614
2165 y(For)h(example,)g(the)f(following)g(two)h(commands)e(ar)m(e)h
(equivalent:)663 2567 y Fp(,config)110 b(,load)f(my-file.scm)663
3030 y(,exec)g(\(config)h('\(load)g("my-file.scm"\)\))614
3426 y Ft(The)56 b(\002le)f Fp(scheme/vm/load-vm.scm)i
Ft(in)e(the)h(sour)m(ce)e(dir)m(ectory)h(contains)g(an)g(example)332
3652 y(of)45 b(an)h Fp(exec)f Ft(pr)m(ogram.)332 4283
y Fm(3.9)238 b(Building)59 b(images)423 4715 y Fp(,dump)110
b Fs(\002lename)e Fp([)p Fs(identi\002cation)p Fp(])787
4941 y Ft(W)-13 b(rites)64 b(the)i(curr)m(ent)e(heap)h(out)h(to)f(a)g
(\002le,)71 b(which)64 b(can)h(then)g(be)g(r)o(un)f(using)h(the)g
(virtual)787 5167 y(machine.)j(The)51 b(new)e(image)g(\002le)h
(includes)f(the)i(command)d(pr)m(ocessor)-13 b(.)70 b(If)50
b(pr)m(esent,)h Fs(iden-)787 5393 y(ti\002cation)45 b
Ft(should)i(be)g(a)g(string)h(\(written)f(with)g(double)g(quotes\);)h
(this)g(string)f(will)g(be)g(part)787 5619 y(of)e(the)h(gr)m(eeting)f
(message)g(as)h(the)f(image)g(starts)h(up.)423 6015 y
Fp(,build)110 b Fs(exp)e(\002lename)787 6241 y Ft(Like)39
b Fp(,dump)p Ft(,)i(except)f(that)f(the)g(image)g(\002le)g(contains)g
(the)g(value)f(of)h Fs(exp)p Ft(,)i(which)d(should)g(be)787
6467 y(a)43 b(pr)m(ocedur)m(e)g(of)h(one)g(ar)m(gument,)f(instead)h(of)
g(the)g(command)f(pr)m(ocessor)-13 b(.)56 b(When)43 b
Fs(\002lename)787 6693 y Ft(is)58 b(r)m(esumed,)j(that)d(pr)m(ocedur)m
(e)g(will)g(be)g(invoked)g(on)g(the)h(VM's)f Fp(-a)g
Ft(ar)m(guments,)j(which)787 6919 y(ar)m(e)j(passed)h(as)g(a)g(list)g
(of)g(strings.)115 b(The)65 b(pr)m(ocedur)m(e)f(should)h(r)m(eturn)f
(an)g(integer)h(which)787 7145 y(is)56 b(r)m(eturned)g(to)g(the)h(pr)m
(ogram)f(that)g(invoked)g(the)h(VM.)g(The)g(command)e(pr)m(ocessor)h
(and)787 7370 y(debugging)f(system)h(ar)m(e)g(not)g(included)g(in)g
(the)g(image)f(\(unless)h(you)g(go)g(to)h(some)f(ef)m(fort)787
7596 y(to)46 b(pr)m(eserve)f(them,)g(such)g(as)h(r)m(etaining)e(a)i
(continuation\).)787 7907 y(Doing)53 b Fp(,flush)h Ft(befor)m(e)f
(building)f(an)i(image)f(will)g(r)m(educe)g(the)g(amount)g(of)h
(debugging)787 8133 y(information)65 b(in)i(the)f(image,)72
b(making)66 b(for)g(a)h(smaller)f(image)g(\002le,)72
b(but)66 b(if)g(an)g(err)m(or)h(oc-)787 8359 y(curs,)81
b(the)75 b(err)m(or)f(message)h(may)f(be)g(less)h(helpful.)143
b(Doing)74 b Fp(,flush)110 b(source)g(maps)787 8585 y
Ft(befor)m(e)61 b(loading)h(any)g(pr)m(ograms)f(used)h(in)g(the)h
(image)e(will)h(make)f(it)i(still)f(smaller)-13 b(.)105
b(See)787 8811 y(section)45 b(3.10)h(for)f(mor)m(e)g(information.)332
9441 y Fm(3.10)238 b(Resource)58 b(query)i(and)f(control)332
9874 y Ft(.)423 10326 y Fp(,time)110 b Fs(exp)787 10552
y Ft(Measur)m(e)44 b(execution)i(time.)423 10948 y Fp(,collect)787
11174 y Ft(Invoke)74 b(the)f(garbage)g(collector)-13
b(.)141 b(Or)m(dinarily)73 b(this)h(happens)g(automatically)-20
b(,)80 b(but)73 b(the)787 11400 y(command)44 b(tells)i(how)f(much)f
(space)i(is)f(available)f(befor)m(e)h(and)g(after)g(the)h(collection.)
423 11797 y Fp(,keep)110 b Fs(kind)3661 12141 y Ft(14)p
eop end
%%Page: 15 23
TeXDict begin 15 22 bop 257 1146 a Fp(,flush)110 b Fs(kind)621
1372 y Ft(These)71 b(contr)m(ol)f(the)h(amount)f(of)h(debugging)f
(information)g(r)m(etained)g(after)h(compiling)621 1597
y(pr)m(ocedur)m(es.)55 b(This)44 b(information)e(can)h(consume)g(a)g
(fair)g(amount)g(of)g(space.)56 b Fs(kind)43 b Ft(is)h(one)f(of)621
1823 y(the)i(following:)839 2288 y Fl(\017)91 b Fp(maps)45
b Ft(-)g(envir)m(onment)g(maps)g(\(local)g(variable)f(names,)h(for)g
(inspector\))839 2625 y Fl(\017)91 b Fp(source)46 b Ft(-)f(sour)m(ce)f
(code)i(for)f(continuations)g(\(displayed)h(by)f(inspector\))839
2962 y Fl(\017)91 b Fp(names)45 b Ft(-)g(pr)m(ocedur)m(e)g(names)g
(\(as)g(displayed)h(by)f Fp(write)h Ft(and)f(in)g(err)m(or)g
(messages\))839 3300 y Fl(\017)91 b Fp(files)45 b Ft(-)g(sour)m(ce)g
(\002le)h(names)621 3765 y(These)67 b(commands)e(r)m(efer)h(to)h(futur)
m(e)e(compilations)h(only)-20 b(,)72 b(not)67 b(to)g(pr)m(ocedur)m(es)f
(that)h(al-)621 3990 y(r)m(eady)50 b(exist.)72 b(T)-17
b(o)51 b(have)f(any)h(ef)m(fect,)g(they)g(must)f(be)g(done)h(befor)m(e)
e(pr)m(ograms)h(ar)m(e)g(loaded.)621 4216 y(The)45 b(default)g(is)h(to)
g(keep)g(all)f(four)g(types.)257 4681 y Fp(,flush)621
4907 y Ft(The)57 b(\003ush)f(command)f(with)i(no)f(ar)m(gument)g
(deletes)i(the)e(database)h(of)g(names)f(of)g(initial)621
5133 y(pr)m(ocedur)m(es.)124 b(Doing)68 b Fp(,flush)g
Ft(befor)m(e)f(a)h Fp(,build)h Ft(or)f Fp(,dump)h Ft(will)e(make)h(the)
g(r)m(esult-)621 5359 y(ing)47 b(image)g(signi\002cantly)g(smaller)-13
b(,)47 b(but)f(will)h(compr)m(omise)g(the)g(information)g(content)g(of)
621 5585 y(many)d(err)m(or)h(messages.)166 6320 y Fm(3.11)238
b(Threads)166 6787 y Ft(Each)47 b(command)f(level)i(has)f(its)h(own)f
(set)h(of)f(thr)m(eads.)63 b(These)48 b(thr)m(eads)f(ar)m(e)h
(suspended)f(when)g(a)166 7013 y(new)53 b(level)h(is)f(enter)m(ed)h
(and)f(r)m(esumed)g(when)g(the)h(owning)f(level)g(again)g(becomes)g
(the)h(curr)m(ent)166 7239 y(level.)i(A)44 b(thr)m(ead)f(that)h(raises)
f(an)h(err)m(or)f(is)g(not)h(r)m(esumed)f(unless)g(explicitly)g(r)m
(estarted)h(using)f(the)166 7464 y Fp(,proceed)k Ft(command.)60
b(In)47 b(addition)g(to)g(any)g(thr)m(eads)f(spawned)h(by)f(the)h(user)
-13 b(,)47 b(each)f(level)g(has)166 7690 y(a)52 b(thr)m(ead)f(that)h(r)
o(uns)e(the)i(command)f(pr)m(ocessor)h(on)f(that)h(level.)75
b(A)52 b(new)f(command-pr)m(ocessor)166 7916 y(thr)m(ead)60
b(is)f(started)i(if)e(the)h(curr)m(ent)f(one)h(dies)g(or)f(is)h
(terminated.)100 b(When)59 b(a)h(command)f(level)g(is)166
8142 y(abandoned)68 b(for)f(a)h(lower)g(level,)74 b(or)68
b(when)f(a)h(level)g(is)g(r)m(estarted)g(using)g Fp(,reset)p
Ft(,)74 b(all)68 b(of)g(the)166 8368 y(thr)m(eads)45
b(on)h(that)g(level)f(ar)m(e)g(terminated)g(and)g(any)h
Fp(dynamic-wind)g Ft(\223after)13 b(\224)45 b(thunks)h(ar)m(e)f(r)o
(un.)448 8616 y(The)h(following)f(commands)f(ar)m(e)h(useful)g(when)g
(debugging)f(multithr)m(eaded)h(pr)m(ograms:)257 9081
y Fp(,resume)110 b([)p Fs(number)p Fp(])621 9307 y Ft(Pops)50
b(out)f(to)i(a)e(given)g(level)h(and)f(r)m(esumes)g(r)o(unning)f(all)h
(thr)m(eads)h(at)g(that)f(level.)69 b Fs(Number)621 9533
y Ft(defaults)45 b(to)h(zer)m(o.)257 9998 y Fp(,threads)621
10223 y Ft(Invokes)38 b(the)g(inspector)h(on)f(a)g(list)h(of)f(the)g
(thr)m(eads)g(r)o(unning)e(at)j(the)f(next)g(lower)g(command)621
10449 y(level.)257 10914 y Fp(,exit-when-done)110 b([)p
Fs(exp)p Fp(])621 11140 y Ft(W)-17 b(aits)53 b(until)f(all)h(user)f
(thr)m(eads)h(have)f(completed)h(and)g(then)g(exits)g(back)f(out)h(to)h
(shell)e(\(or)621 11366 y(executive)35 b(or)i(whatever)f(invoked)g
(Scheme)g(48)g(in)h(the)f(\002rst)h(place\).)53 b Fs(Exp)36
b Ft(should)h(evaluate)621 11592 y(to)46 b(an)f(integer)g(which)g(is)g
(then)h(r)m(eturned)e(to)i(the)g(calling)f(pr)m(ogram.)3495
12141 y(15)p eop end
%%Page: 16 24
TeXDict begin 16 23 bop 332 1146 a Fm(3.12)238 b(Quite)58
b(obscure)423 1568 y Fp(,go)109 b Fs(exp)787 1793 y Ft(This)67
b(is)g(like)g Fp(,exit)110 b Fs(exp)66 b Ft(except)i(that)f(the)g
(evaluation)g(of)g Fs(exp)f Ft(is)h(tail-r)m(ecursive)e(with)787
2019 y(r)m(espect)71 b(to)h(the)g(command)f(pr)m(ocessor)-13
b(.)135 b(This)72 b(means)f(that)h(the)f(command)g(pr)m(ocessor)787
2245 y(itself)46 b(can)g(pr)m(obably)f(be)h(GC'ed,)g(should)g(a)h
(garbage)e(collection)h(occur)g(in)g(the)g(execution)787
2471 y(of)f Fs(exp)p Ft(.)56 b(If)46 b(an)f(err)m(or)g(occurs)f(Scheme)
i(48)f(will)g(exit)g(with)g(a)h(non-zer)m(o)e(value.)423
2846 y Fp(,translate)110 b Fs(fr)m(om)e(to)787 3072 y
Ft(For)64 b Fp(load)g Ft(and)g(the)g Fp(,load)h Ft(command)e(\(but)g
(not)h(for)g Fp(open-)p Fl(f)p Fp(in|out)p Fl(g)p Fp(put-file)p
Ft(\),)787 3298 y(\002le)45 b(names)g(beginning)g(with)g(the)h(string)g
Fs(fr)m(om)f Ft(will)g(be)g(changed)g(so)h(that)g(the)g(initial)f
Fs(fr)m(om)787 3524 y Ft(is)g(r)m(eplaced)g(by)g(the)h(string)f
Fs(to)p Ft(.)56 b(E.g.)1117 3899 y Fp(,translate)110
b(/usr/gjc/)g(/zu/gjc/)787 4274 y Ft(will)59 b(cause)h
Fp(\(load)110 b("/usr/gjc/foo.scm"\))62 b Ft(to)f(have)f(the)h(same)f
(ef)m(fect)f(as)i Fp(\(load)787 4500 y("/zu/gjc/foo.scm"\))p
Ft(.)423 4875 y Fp(,from-file)110 b Fs(\002lename)e(form)h
Fp(...)g(,end)787 5101 y Ft(This)48 b(is)f(used)h(by)f(the)h
Fp(cmuscheme48)h Ft(Emacs)e(library)f(to)j(indicate)e(the)h(\002le)g
(fr)m(om)e(which)787 5327 y(the)55 b Fs(form)p Ft(s)g(came.)86
b Fs(Filename)54 b Ft(is)h(then)g(used)g(by)g(the)h(command)e(pr)m
(ocessor)i(to)f(determine)787 5553 y(the)45 b(package)h(in)f(which)f
(the)i Fs(form)p Ft(s)f(ar)m(e)g(to)h(be)f(evaluated.)3661
12141 y(16)p eop end
%%Page: 17 25
TeXDict begin 17 24 bop 166 2391 a Fo(Chapter)87 b(4)166
3222 y Fr(Module)103 b(system)166 4145 y Ft(This)68 b(chapter)g
(describes)g(Scheme)f(48's)h(module)f(system.)125 b(The)68
b(module)g(system)g(is)g(unique)166 4371 y(in)f(the)g(extent)g(to)h
(which)e(it)h(supports)h(both)e(static)i(linking)e(and)h(rapid)g
(turnar)m(ound)f(during)166 4597 y(pr)m(ogram)55 b(development.)87
b(The)56 b(design)g(was)f(in\003uenced)f(by)h(Standar)m(d)h(ML)f
(modules[7)o(])g(and)166 4823 y(by)h(the)g(module)f(system)h(for)f
(Scheme)h(Xer)m(ox[4)o(].)88 b(It)56 b(has)g(also)g(been)g(shaped)g(by)
f(the)h(needs)g(of)166 5048 y(Scheme)37 b(48,)i(which)c(is)i(designed)h
(to)f(r)o(un)f(both)h(on)g(workstations)g(and)g(on)g(r)m(elatively)f
(small)g(\(less)166 5274 y(than)45 b(1)h(Mbyte\))f(embedded)g(contr)m
(ollers.)448 5500 y(Except)g(wher)m(e)f(noted,)i(everything)e
(described)g(her)m(e)g(is)h(implemented)f(in)h(Scheme)f(48,)h(and)166
5726 y(exer)m(cised)g(by)g(the)h(Scheme)f(48)g(implementation)g(and)g
(some)h(application)g(pr)m(ograms.)448 5952 y(Unlike)e(the)g(Common)f
(Lisp)h(package)g(system,)h(the)f(module)f(system)h(described)f(her)m
(e)h(con-)166 6178 y(tr)m(ols)i(the)f(mapping)g(of)h(names)f(to)h
(denotations,)g(not)g(the)g(mapping)f(of)g(strings)h(to)g(symbols.)166
6777 y Fm(4.1)238 b(Introduction)166 7200 y Ft(The)53
b(module)f(system)h(supports)g(the)g(str)o(uctur)m(ed)e(division)i(of)f
(a)h(corpus)f(of)g(Scheme)h(softwar)m(e)166 7426 y(into)48
b(a)f(set)g(of)g(modules.)62 b(Each)47 b(module)g(has)g(its)g(own)g
(isolated)h(namespace,)g(with)f(visibility)f(of)166 7651
y(bindings)41 b(contr)m(olled)h(by)g(module)g(descriptions)g(written)g
(in)g(a)g(special)g Fs(con\002guration)e(language.)448
7877 y Ft(A)54 b(module)e(may)h(be)g(instantiated)g(multiple)f(times,)k
(pr)m(oducing)c(several)h Fs(packages)p Ft(,)g(just)g(as)166
8103 y(a)60 b(lambda-expr)m(ession)f(can)g(be)h(instantiated)h
(multiple)e(times)h(to)h(pr)m(oduce)f(several)f(dif)m(fer)m(ent)166
8329 y(pr)m(ocedur)m(es.)80 b(Since)54 b(single)f(instantiation)h(is)f
(the)h(normal)e(case,)k(we)d(will)g(defer)g(discussion)g(of)166
8555 y(multiple)66 b(instantiation)g(until)g(a)g(later)h(section.)119
b(For)67 b(now)f(you)g(can)g(think)g(of)g(a)h(package)f(as)166
8781 y(simply)45 b(a)h(module's)e(internal)h(envir)m(onment)g(mapping)g
(names)g(to)h(denotations.)448 9007 y(A)36 b(module)e(exports)h
(bindings)f(by)h(pr)m(oviding)f(views)h(onto)g(the)g(underlying)f
(package.)53 b(Such)166 9233 y(a)37 b(view)f(is)h(called)f(a)h
Fs(structur)m(e)e Ft(\(terminology)h(fr)m(om)g(Standar)m(d)h(ML\).)g
(One)f(module)h(may)f(pr)m(ovide)166 9458 y(several)63
b(dif)m(fer)m(ent)g(views.)111 b(A)64 b(str)o(uctur)m(e)e(is)i(just)f
(a)h(subset)f(of)h(the)f(package's)h(bindings.)111 b(The)166
9684 y(particular)45 b(set)h(of)f(names)g(whose)g(bindings)g(ar)m(e)g
(exported)h(is)f(the)h(str)o(uctur)m(e's)e Fs(interface)p
Ft(.)448 9910 y(A)36 b(module)e(imports)h(bindings)f(fr)m(om)g(other)h
(modules)g(by)f(either)h Fs(opening)f Ft(or)h Fs(accessing)e
Ft(some)166 10136 y(str)o(uctur)m(es)71 b(that)h(ar)m(e)g(built)f(on)h
(other)g(packages.)137 b(When)71 b(a)h(str)o(uctur)m(e)f(is)h(opened,)
79 b(all)72 b(of)g(its)166 10362 y(exported)46 b(bindings)f(ar)m(e)g
(visible)g(in)g(the)g(client)h(package.)448 10588 y(For)g(example:)497
10965 y Fp(\(define-structure)110 b(foo)g(\(export)f(a)h(c)f(cons\))715
11191 y(\(open)g(scheme\))715 11417 y(\(begin)h(\(define)f(a)g(1\))1479
11643 y(\(define)g(\(b)h(x\))f(\(+)g(a)g(x\)\))3495 12141
y Ft(17)p eop end
%%Page: 18 26
TeXDict begin 18 25 bop 1645 1146 a Fp(\(define)109 b(\(c)h(y\))f(\(*)g
(\(b)g(a\))h(y\)\)\)\))663 1602 y(\(define-structure)g(bar)g(\(export)g
(d\))881 1830 y(\(open)g(scheme)f(foo\))881 2058 y(\(begin)h(\(define)f
(\(d)h(w\))f(\(+)g(a)g(\(c)h(w\)\)\)\)\))332 2441 y Ft(This)40
b(con\002guration)f(de\002nes)g(two)h(str)o(uctur)m(es,)g
Fp(foo)f Ft(and)h Fp(bar)p Ft(.)55 b Fp(foo)39 b Ft(is)h(a)f(view)g(on)
h(a)f(package)g(in)332 2667 y(which)f(the)g Fp(scheme)h
Ft(str)o(uctur)m(e's)e(bindings)h(\(including)f Fp(define)i
Ft(and)g Fp(+)p Ft(\))f(ar)m(e)g(visible,)h(together)332
2893 y(with)70 b(bindings)f(for)h Fp(a)p Ft(,)77 b Fp(b)p
Ft(,)g(and)70 b Fp(c)p Ft(.)131 b Fp(foo)p Ft('s)70 b(interface)f(is)h
Fp(\(export)110 b(a)f(c)g(cons\))p Ft(,)77 b(so)71 b(of)f(the)332
3119 y(bindings)47 b(in)g(its)g(underlying)g(package,)h
Fp(foo)f Ft(only)h(exports)f(those)h(thr)m(ee.)62 b(Similarly)-20
b(,)47 b(str)o(uctur)m(e)332 3345 y Fp(bar)58 b Ft(consists)g(of)g(the)
g(binding)e(of)i Fp(d)g Ft(fr)m(om)f(a)g(package)h(in)f(which)g(both)h
Fp(scheme)p Ft('s)g(and)f Fp(foo)p Ft('s)332 3571 y(bindings)j(ar)m(e)h
(visible.)102 b Fp(foo)p Ft('s)61 b(binding)f(of)h Fp(cons)g
Ft(is)g(imported)g(fr)m(om)f(the)h(Scheme)f(str)o(uctur)m(e)332
3796 y(and)45 b(then)h(r)m(e-exported.)614 4024 y(A)88
b(module's)f(body)-20 b(,)99 b(the)88 b(part)g(following)f
Fp(begin)h Ft(in)f(the)h(above)f(example,)99 b(is)87
b(evalu-)332 4250 y(ated)c(in)f(an)h(isolated)g(lexical)f(scope)h
(completely)g(speci\002ed)g(by)f(the)h(package)f(de\002nition's)332
4476 y Fp(open)93 b Ft(and)g Fp(access)h Ft(clauses.)198
b(In)93 b(particular)-13 b(,)104 b(the)94 b(binding)e(of)g(the)i
(syntactic)e(operator)332 4702 y Fp(define-structure)46
b Ft(is)e(not)h(visible)e(unless)h(it)g(comes)g(fr)m(om)f(some)i
(opened)g(str)o(uctur)m(e.)55 b(Sim-)332 4928 y(ilarly)-20
b(,)74 b(bindings)67 b(fr)m(om)g(the)h Fp(scheme)h Ft(str)o(uctur)m(e)e
(ar)m(en't)g(visible)g(unless)h(they)h(become)e(so)h(by)332
5153 y Fp(scheme)46 b Ft(\(or)f(an)g(equivalent)g(str)o(uctur)m(e\))f
(being)h(opened.)332 5764 y Fm(4.2)238 b(The)60 b(con\002guration)f
(language)332 6190 y Ft(The)d(con\002guration)f(language)g(consists)h
(of)f(top-level)g(de\002ning)h(forms)e(for)h(modules)h(and)f(in-)332
6416 y(terfaces.)h(Its)47 b(syntax)e(is)g(given)h(in)f(\002gur)m(e)g
(4.2.)614 6644 y(A)67 b Fp(define-structure)i Ft(form)c(intr)m(oduces)h
(a)h(binding)f(of)g(a)h(name)f(to)h(a)g(str)o(uctur)m(e.)119
b(A)332 6870 y(str)o(uctur)m(e)38 b(is)i(a)f(view)g(on)g(an)g
(underlying)g(package)h(which)e(is)h(cr)m(eated)h(accor)m(ding)e(to)i
(the)g(clauses)332 7096 y(of)i(the)g Fp(define-structure)h
Ft(form.)55 b(Each)42 b(str)o(uctur)m(e)e(has)i(an)g(interface)f(that)h
(speci\002es)g(which)332 7321 y(bindings)47 b(in)h(the)g(str)o(uctur)m
(e's)f(underlying)g(package)h(can)g(be)f(seen)h(via)g(that)g(str)o
(uctur)m(e)f(in)h(other)332 7547 y(packages.)614 7775
y(An)65 b Fp(open)g Ft(clause)f(speci\002es)g(which)g(str)o(uctur)m(es)
f(will)h(be)g(opened)h(up)f(for)g(use)h(inside)f(the)332
8001 y(new)50 b(package.)73 b(At)52 b(least)f(one)g(str)o(uctur)m(e)f
(must)g(be)g(speci\002ed)i(or)e(else)h(it)g(will)g(be)f(impossible)h
(to)332 8227 y(write)44 b(any)g(useful)f(pr)m(ograms)g(inside)h(the)h
(package,)g(since)e Fp(define)p Ft(,)j Fp(lambda)p Ft(,)f
Fp(cons)p Ft(,)g(etc.)g(will)332 8453 y(be)62 b(unavailable.)105
b(Packages)62 b(typically)g(include)g Fp(scheme)p Ft(,)67
b(which)61 b(exports)i(all)f(bindings)f(ap-)332 8679
y(pr)m(opriate)51 b(to)f(Revised)1978 8613 y Fn(5)2108
8679 y Ft(Scheme,)h(in)f(an)g Fp(open)h Ft(clause.)70
b(For)50 b(building)f(str)o(uctur)m(es)g(that)i(export)332
8904 y(str)o(uctur)m(es,)g(ther)m(e)f(is)g(a)h Fp(defpackage)g
Ft(package)f(that)h(exports)g(the)f(operators)h(of)f(the)h(con\002gu-)
332 9130 y(ration)58 b(language.)96 b(Many)58 b(other)g(str)o(uctur)m
(es,)j(such)d(as)g(r)m(ecor)m(d)g(and)g(hash)g(table)g(facilities,)k
(ar)m(e)332 9356 y(also)46 b(available)e(in)h(the)h(Scheme)f(48)g
(implementation.)614 9584 y(The)59 b Fp(modify)p Ft(,)j
Fp(subset)p Ft(,)h(and)58 b Fp(prefix)h Ft(forms)e(pr)m(oduce)h(new)g
(views)g(on)g(existing)g(str)o(uc-)332 9810 y(tur)m(es)j(by)f(r)m
(enaming)g(or)g(hiding)h(exported)g(names.)103 b Fp(Subset)61
b Ft(r)m(eturns)f(a)h(new)f(str)o(uctur)m(e)g(that)332
10036 y(exports)f(only)g(the)f(listed)h(names)f(fr)m(om)f(its)i
Fl(h)p Ft(str)o(uctur)m(e)p Fl(i)d Ft(ar)m(gument.)94
b Fp(With-prefix)60 b Ft(r)m(eturns)332 10261 y(a)j(new)f(str)o(uctur)m
(e)f(that)i(adds)f Fl(h)p Ft(pr)m(e\002x)p Fl(i)g Ft(to)h(each)f(of)g
(the)h(names)f(exported)h(by)f(the)h Fl(h)p Ft(str)o(uctur)m(e)p
Fl(i)332 10487 y Ft(ar)m(gument.)56 b(For)45 b(example,)h(if)f(str)o
(uctur)m(e)f Fp(s)i Ft(exports)g Fp(a)f Ft(and)g Fp(b)p
Ft(,)h(then)663 10873 y Fp(\(subset)110 b(s)f(\(a\)\))332
11257 y Ft(exports)46 b(only)g Fp(a)f Ft(and)663 11643
y Fp(\(with-prefix)110 b(s)f(p/\))3661 12141 y Ft(18)p
eop end
%%Page: 19 27
TeXDict begin 19 26 bop 166 1121 a Fl(h)p Ft(con\002guration)p
Fl(i)44 b(\000)-29 b(!)45 b(h)p Ft(de\002nition)p Fl(i)2703
1055 y Fj(\003)166 1347 y Fl(h)p Ft(de\002nition)p Fl(i)g(\000)-30
b(!)91 b Fp(\(define-structure)111 b Fl(h)p Ft(name)p
Fl(i)c(h)p Ft(interface)p Fl(i)h(h)p Ft(clause)p Fl(i)5766
1281 y Fj(\003)5845 1347 y Fp(\))1380 1573 y Fl(j)90
b Fp(\(define-structures)111 b(\(\()p Fl(h)p Ft(name)p
Fl(i)d(h)p Ft(interface)p Fl(i)n Fp(\))5453 1507 y Fj(\003)5532
1573 y Fp(\))h Fl(h)p Ft(clause)p Fl(i)6390 1507 y Fj(\003)6469
1573 y Fp(\))1380 1799 y Fl(j)90 b Fp(\(define-interface)111
b Fl(h)p Ft(name)p Fl(i)c(h)p Ft(interface)p Fl(i)o Fp(\))1380
2024 y Fl(j)90 b Fp(\(define-syntax)110 b Fl(h)p Ft(name)p
Fl(i)e(h)p Ft(transformer)m(-spec)p Fl(i)n Fp(\))166
2250 y Fl(h)p Ft(clause)p Fl(i)44 b(\000)-30 b(!)91 b
Fp(\(open)110 b Fl(h)p Ft(str)o(uctur)m(e)p Fl(i)2753
2184 y Fj(\003)2832 2250 y Fp(\))1094 2476 y Fl(j)90
b Fp(\(access)110 b Fl(h)p Ft(name)p Fl(i)2694 2410 y
Fj(\003)2772 2476 y Fp(\))1094 2702 y Fl(j)90 b Fp(\(begin)110
b Fl(h)p Ft(pr)m(ogram)p Fl(i)o Fp(\))1094 2928 y Fl(j)90
b Fp(\(files)110 b Fl(h)p Ft(\002lespec)p Fl(i)2744 2862
y Fj(\003)2823 2928 y Fp(\))1094 3154 y Fl(j)90 b Fp(\(optimize)110
b Fl(h)p Ft(optimize-spec)p Fl(i)3594 3088 y Fj(\003)3673
3154 y Fp(\))1094 3379 y Fl(j)90 b Fp(\(for-syntax)110
b Fl(h)p Ft(clause)p Fl(i)3184 3313 y Fj(\003)3263 3379
y Fp(\))166 3605 y Fl(h)p Ft(interface)p Fl(i)44 b(\000)-30
b(!)91 b Fp(\(export)110 b Fl(h)p Ft(item)p Fl(i)2807
3539 y Fj(\003)2886 3605 y Fp(\))1292 3831 y Fl(j)90
b(h)p Ft(name)p Fl(i)1292 4057 y(j)g Fp(\(compound-interface)111
b Fl(h)p Ft(interface)p Fl(i)4452 3991 y Fj(\003)4531
4057 y Fp(\))166 4283 y Fl(h)p Ft(item)p Fl(i)45 b(\000)-30
b(!)91 b(h)p Ft(name)p Fl(i)955 4508 y(j)g Fp(\()p Fl(h)p
Ft(name)p Fl(i)108 b(h)p Ft(type)p Fl(i)p Fp(\))955 4734
y Fl(j)91 b Fp(\(\()p Fl(h)p Ft(name)p Fl(i)1901 4668
y Fj(\003)1979 4734 y Fp(\))110 b Fl(h)p Ft(type)p Fl(i)p
Fp(\))166 4960 y Fl(h)p Ft(str)o(uctur)m(e)p Fl(i)44
b(\000)-30 b(!)90 b(h)p Ft(name)p Fl(i)1317 5186 y(j)g
Fp(\(modify)110 b Fl(h)p Ft(str)o(uctur)m(e)p Fl(i)d(h)p
Ft(modi\002er)p Fl(i)4137 5120 y Fj(\003)4216 5186 y
Fp(\))1317 5412 y Fl(j)90 b Fp(\(subset)110 b Fl(h)p
Ft(str)o(uctur)m(e)p Fl(i)d Fp(\()p Fl(h)p Ft(name)p
Fl(i)3998 5346 y Fj(\003)4077 5412 y Fp(\)\))1317 5638
y Fl(j)90 b Fp(\(with-prefix)111 b Fl(h)p Ft(str)o(uctur)m(e)p
Fl(i)c(h)p Ft(name)p Fl(i)n Fp(\))166 5863 y Fl(h)p Ft(modi\002er)p
Fl(i)45 b(\000)-30 b(!)90 b Fp(\(expose)110 b Fl(h)p
Ft(name)p Fl(i)2888 5797 y Fj(\003)2967 5863 y Fp(\))1288
6089 y Fl(j)90 b Fp(\(hide)110 b Fl(h)p Ft(name)p Fl(i)2670
6023 y Fj(\003)2749 6089 y Fp(\))1288 6315 y Fl(j)90
b Fp(\(rename)110 b(\()p Fl(h)p Ft(name)p Fl(i)2997 6342
y Fn(0)3185 6315 y Fl(h)p Ft(name)p Fl(i)3771 6342 y
Fn(1)3850 6315 y Fp(\))3959 6249 y Fj(\003)4038 6315
y Fp(\))1288 6541 y Fl(j)90 b Fp(\(alias)110 b(\()p Fl(h)p
Ft(name)p Fl(i)2888 6568 y Fn(0)3076 6541 y Fl(h)p Ft(name)p
Fl(i)3662 6568 y Fn(1)3741 6541 y Fp(\))3850 6475 y Fj(\003)3929
6541 y Fp(\))1288 6767 y Fl(j)90 b Fp(\(prefix)110 b
Fl(h)p Ft(name)p Fl(i)o Fp(\))2005 7584 y Ft(Figur)m(e)45
b(4.1:)57 b(The)46 b(con\002guration)f(language.)166
8155 y(exports)h Fp(a)g Ft(as)f Fp(p/a)h Ft(and)f Fp(b)h
Ft(as)f Fp(p/b)p Ft(.)448 8383 y(Both)84 b Fp(subset)g
Ft(and)f Fp(with-prefix)h Ft(ar)m(e)f(simple)g(macr)m(os)f(that)h
(expand)h(into)f(uses)g(of)166 8609 y Fp(modify)p Ft(,)j(a)78
b(mor)m(e)f(general)g(r)m(enaming)f(form.)152 b(In)77
b(a)g Fp(modify)h Ft(str)o(uctur)m(e)e(speci\002cation)i(the)166
8835 y Fl(h)p Ft(command)p Fl(i)n Ft(s)58 b(ar)m(e)g(applied)g(to)h
(the)f(names)g(exported)g(by)g Fl(h)p Ft(str)o(uctur)m(e)p
Fl(i)e Ft(to)j(pr)m(oduce)e(a)h(new)g(set)166 9060 y(of)50
b(names)f(for)g(the)h Fl(h)p Ft(str)o(uctur)m(e)p Fl(i)n
Ft('s)f(bindings.)69 b Fp(Expose)50 b Ft(makes)g(only)f(the)h(listed)g
(names)f(visible.)166 9286 y Fp(Hide)55 b Ft(makes)g(all)f(but)g(the)h
(listed)g(names)f(visible.)84 b Fp(Rename)55 b Ft(makes)g(each)f
Fl(h)p Ft(name)p Fl(i)6124 9313 y Fn(0)6257 9286 y Ft(visible)g(as)166
9512 y Fl(h)p Ft(name)p Fl(i)752 9539 y Fn(1)883 9512
y Ft(name)e(and)h(not)g(visible)f(as)g Fl(h)p Ft(name)p
Fl(i)3443 9539 y Fn(0)3575 9512 y Ft(,)j(while)d Fp(alias)h
Ft(makes)f(each)h Fl(h)p Ft(name)p Fl(i)6348 9539 y Fn(0)6480
9512 y Ft(visible)166 9738 y(as)39 b(both)h Fl(h)p Ft(name)p
Fl(i)1364 9765 y Fn(0)1482 9738 y Ft(and)f Fl(h)p Ft(name)p
Fl(i)2415 9765 y Fn(1)2494 9738 y Ft(.)54 b Fp(Prefix)40
b Ft(adds)g Fl(h)p Ft(name)p Fl(i)e Ft(to)i(the)g(beginning)e(of)h
(each)g(exported)166 9964 y(name.)56 b(The)46 b(modi\002ers)f(ar)m(e)g
(applied)h(fr)m(om)f(right)g(to)h(left.)57 b(Thus)497
10352 y Fp(\(modify)109 b(scheme)h(\(prefix)g(foo/\))f(\(rename)h
(\(car)g(bus\)\)\)\))166 10737 y Ft(makes)45 b Fp(car)h
Ft(available)e(as)i Fp(foo/bus)p Ft(..)448 10966 y(The)72
b(package's)g(body)f(is)h(speci\002ed)g(by)f Fp(begin)h
Ft(and/or)g Fp(files)g Ft(clauses.)135 b Fp(begin)72
b Ft(and)166 11191 y Fp(files)64 b Ft(have)f(the)g(same)g(semantics,)k
(except)d(that)g(for)e Fp(begin)i Ft(the)g(text)f(is)h(given)e(dir)m
(ectly)h(in)166 11417 y(the)56 b(package)g(de\002nition,)j(while)c(for)
h Fp(files)g Ft(the)g(text)h(is)e(stor)m(ed)i(somewher)m(e)e(in)g(the)h
(\002le)g(sys-)166 11643 y(tem.)99 b(The)60 b(body)g(consists)g(of)f(a)
h(Scheme)f(pr)m(ogram,)k(that)d(is,)j(a)d(sequence)f(of)g
(de\002nitions)h(and)3495 12141 y(19)p eop end
%%Page: 20 28
TeXDict begin 20 27 bop 332 1146 a Ft(expr)m(essions)50
b(to)h(be)e(evaluated)h(in)f(or)m(der)-13 b(.)70 b(In)50
b(practice,)h(we)f(always)f(use)h Fp(files)h Ft(in)e(pr)m(efer)m(ence)
332 1372 y(to)d Fp(begin)p Ft(;)g Fp(begin)g Ft(exists)g(mainly)f(for)g
(expository)h(purposes.)614 1597 y(A)56 b(name's)d(imported)j(binding)e
(may)g(be)g(lexically)h(overridden)f(or)h Fs(shadowed)f
Ft(by)g(de\002ning)332 1823 y(the)44 b(name)f(using)g(a)g(de\002ning)h
(form)e(such)h(as)h Fp(define)g Ft(or)f Fp(define-syntax)p
Ft(.)58 b(This)44 b(will)e(cr)m(eate)332 2049 y(a)53
b(new)g(binding)f(without)h(having)g(any)g(ef)m(fect)f(on)h(the)g
(binding)g(in)g(the)g(opened)h(package.)80 b(For)332
2275 y(example,)67 b(one)c(can)g(do)g Fp(\(define)109
b(car)h('chevy\))63 b Ft(without)g(af)m(fecting)e(the)i(binding)f(of)h
(the)332 2501 y(name)45 b Fp(car)h Ft(in)f(the)g Fp(scheme)h
Ft(package.)614 2726 y(Assignments)54 b(\(using)f Fp(set!)p
Ft(\))g(to)h(imported)f(and)h(unde\002ned)f(variables)f(ar)m(e)h(not)h
(allowed.)332 2952 y(In)49 b(or)m(der)f(to)h Fp(set!)g
Ft(a)f(top-level)g(variable,)h(the)g(package)f(body)g(must)g(contain)h
(a)f Fp(define)h Ft(form)332 3178 y(de\002ning)40 b(that)g(variable.)53
b(Applied)41 b(to)g(bindings)e(fr)m(om)f(the)i Fp(scheme)h
Ft(str)o(uctur)m(e,)f(this)f(r)m(estriction)332 3404
y(is)46 b(compatible)e(with)i(the)f(r)m(equir)m(ements)f(of)h(the)h
(Revised)4412 3338 y Fn(5)4537 3404 y Ft(Scheme)f(r)m(eport.)614
3630 y(It)d(is)g(an)f(err)m(or)g(for)g(two)h(of)f(a)h(package's)f
(opened)h(str)o(uctur)m(es)e(to)i(export)g(two)g(dif)m(fer)m(ent)e
(bind-)332 3856 y(ings)45 b(for)f(the)h(same)f(name.)56
b(However)-13 b(,)44 b(the)h(curr)m(ent)f(implementation)g(does)h(not)g
(check)f(for)g(this)332 4081 y(situation;)e(a)e(name's)f(binding)g(is)h
(always)g(taken)g(fr)m(om)f(the)h(str)o(uctur)m(e)e(that)i(is)g(listed)
h(\002rst)f(within)332 4307 y(the)46 b Fp(open)g Ft(clause.)56
b(This)45 b(may)g(be)h(\002xed)f(in)g(the)h(futur)m(e.)614
4533 y(File)87 b(names)e(in)h(a)g Fp(files)h Ft(clause)e(can)h(be)g
(symbols,)96 b(strings,)h(or)86 b(lists)h(\(Maclisp-style)332
4759 y(\223namelists\224\).)126 b(A)69 b(\223)p Fp(.scm)p
Ft(\224)f(\002le)h(type)h(suf)m(\002x)d(is)i(assumed.)126
b(Symbols)68 b(ar)m(e)g(converted)h(to)g(\002le)332 4985
y(names)h(by)g(converting)g(to)h(upper)g(or)f(lower)g(case)h(as)f(appr)
m(opriate)h(for)f(the)h(host)g(operating)332 5210 y(system.)152
b(A)78 b(namelist)e(is)h(an)g(operating-system-independent)g(way)g(to)h
(specify)f(a)g(\002le)g(ob-)332 5436 y(tained)59 b(fr)m(om)f(a)g
(subdir)m(ectory)-20 b(.)96 b(For)59 b(example,)j(the)d(namelist)f
Fp(\(rts)110 b(record\))59 b Ft(speci\002es)g(the)332
5662 y(\002le)46 b Fp(record.scm)g Ft(in)f(the)h Fp(rts)f
Ft(subdir)m(ectory)-20 b(.)614 5888 y(If)60 b(the)h Fp
(define-structure)g Ft(form)e(was)h(itself)g(obtained)g(fr)m(om)f(a)h
(\002le,)k(then)d(\002le)f(names)332 6114 y(in)50 b Fp(files)i
Ft(clauses)e(ar)m(e)g(interpr)m(eted)h(r)m(elative)f(to)h(the)g(dir)m
(ectory)f(in)h(which)e(the)i(\002le)g(containing)332
6340 y(the)g Fp(define-structure)i Ft(form)d(was)h(found.)74
b(Y)-17 b(ou)51 b(can't)g(at)g(pr)m(esent)h(put)f(an)g(absolute)g(path)
332 6565 y(name)45 b(in)g(the)h Fp(files)g Ft(list.)332
7163 y Fm(4.3)238 b(Interfaces)332 7584 y Fp(define-interface)614
7810 y Ft(An)48 b(interface)f(can)g(be)h(thought)f(of)h(as)f(the)h
(type)h(of)e(a)h(str)o(uctur)m(e.)62 b(In)47 b(its)h(basic)f(form)g(it)
h(is)g(just)332 8036 y(a)i(list)h(of)f(variable)f(names,)j(written)e
Fp(\(export)110 b Fs(name)f Fp(...\))p Ft(.)72 b(However)-13
b(,)51 b(in)f(place)g(of)g(a)h(name)332 8262 y(one)56
b(may)g(write)f Fp(\()p Fs(name)109 b(type)p Fp(\))p
Ft(,)59 b(indicating)c(the)h(type)h(of)e Fs(name)p Ft('s)h(binding.)87
b(The)56 b(type)h(\002eld)f(is)332 8488 y(optional,)47
b(except)e(that)h(exported)g(macr)m(os)f(must)g(be)g(indicated)g(with)g
(type)h Fp(:syntax)p Ft(.)614 8714 y(Interfaces)41 b(may)f(be)g(either)
h(anonymous,)h(as)e(in)h(the)g(example)f(in)g(the)h(intr)m(oduction,)h
(or)f(they)332 8939 y(may)k(be)g(given)g(names)g(by)g(a)h
Fp(define-interface)h Ft(form,)e(for)g(example)663 9314
y Fp(\(define-interface)110 b(foo-interface)h(\(export)e(a)h(c)f
(cons\)\))663 9540 y(\(define-structure)h(foo)g(foo-interface)g(...\))
332 9914 y Ft(In)56 b(principle,)i(interfaces)d(needn't)g(ever)g(be)g
(named.)87 b(If)55 b(an)h(interface)e(had)i(to)g(be)f(given)g(at)h(the)
332 10140 y(point)i(of)f(a)g(str)o(uctur)m(e's)f(use)h(as)g(well)g(as)g
(at)g(the)h(point)g(of)f(its)g(de\002nition,)k(it)c(would)g(be)g(impor)
m(-)332 10365 y(tant)51 b(to)f(name)g(interfaces)g(in)g(or)m(der)g(to)h
(avoid)f(having)f(to)i(write)f(them)g(out)h(twice,)g(with)f(risk)g(of)
332 10591 y(mismatch)44 b(should)i(the)f(interface)g(ever)g(change.)56
b(But)46 b(they)f(don't.)614 10817 y(Still,)i(ther)m(e)e(ar)m(e)g
(several)g(r)m(easons)g(to)h(use)g Fp(define-interface)p
Ft(:)559 11191 y(1.)92 b(It)55 b(is)f(important)g(to)h(separate)g(the)g
(interface)e(de\002nition)i(fr)m(om)e(the)h(package)h(de\002nitions)787
11417 y(when)d(ther)m(e)h(ar)m(e)f(multiple)h(distinct)g(str)o(uctur)m
(es)e(that)j(have)e(the)h(same)g(interface)f(\227)h(that)787
11643 y(is,)46 b(multiple)f(implementations)g(of)g(the)h(same)f
(abstraction.)3661 12141 y(20)p eop end
%%Page: 21 29
TeXDict begin 21 28 bop 393 1146 a Ft(2.)92 b(It)50 b(is)f
(conceptually)h(cleaner)-13 b(,)50 b(and)f(often)h(useful)f(for)g
(documentation)g(purposes,)j(to)e(sep-)621 1372 y(arate)45
b(a)g(module's)g(speci\002cation)g(\(interface\))f(fr)m(om)h(its)g
(implementation)g(\(package\).)393 1738 y(3.)92 b(Our)36
b(experience)g(is)h(that)g(con\002gurations)g(that)g(ar)m(e)f
(separated)i(into)f(interface)f(de\002nitions)621 1964
y(and)g(package)g(de\002nitions)h(ar)m(e)f(easier)g(to)h(r)m(ead;)i
(the)e(long)f(lists)h(of)f(exported)h(bindings)e(just)621
2190 y(get)45 b(in)h(the)f(way)g(most)h(of)f(the)h(time.)448
2543 y(The)55 b Fp(compound-interface)h Ft(operator)f(forms)f(an)g
(interface)f(that)i(is)f(the)h(union)f(of)g(two)166 2769
y(or)46 b(mor)m(e)e(component)i(interfaces.)56 b(For)46
b(example,)497 3122 y Fp(\(define-interface)110 b(bar-interface)715
3347 y(\(compound-interface)h(foo-interface)f(\(export)g(mumble\)\)\))
166 3701 y Ft(de\002nes)46 b Fp(bar-interface)g Ft(to)g(be)f
Fp(foo-interface)i Ft(with)e(the)h(name)f Fp(mumble)h
Ft(added.)166 4293 y Fm(4.4)238 b(Macros)166 4715 y Ft(Hygienic)76
b(macr)m(os,)84 b(as)76 b(described)g(in)g([2,)h(3],)84
b(ar)m(e)76 b(implemented.)149 b(Str)o(uctur)m(es)76
b(may)g(export)166 4941 y(macr)m(os;)68 b(auxiliary)60
b(names)g(intr)m(oduced)g(into)h(the)g(expansion)g(ar)m(e)f(r)m
(esolved)h(in)f(the)h(envir)m(on-)166 5167 y(ment)45
b(of)g(the)h(macr)m(o's)e(de\002nition.)448 5393 y(For)i(example,)f
(the)h Fp(scheme)g Ft(str)o(uctur)m(e's)e Fp(delay)i
Ft(macr)m(o)e(is)i(de\002ned)f(by)g(the)h(r)m(ewrite)f(r)o(ule)497
5746 y Fp(\(delay)109 b Fs(exp)p Fp(\))218 b Fi(=)-30
b Fl(\))218 b Fp(\(make-promise)111 b(\(lambda)e(\(\))h
Fs(exp)p Fp(\)\).)166 6099 y Ft(The)58 b(variable)f Fp(make-promise)i
Ft(is)f(de\002ned)g(in)f(the)h Fp(scheme)g Ft(str)o(uctur)m(e's)e
(underlying)i(pack-)166 6325 y(age,)69 b(but)64 b(is)g(not)g(exported.)
113 b(A)64 b(use)g(of)g(the)g Fp(delay)g Ft(macr)m(o,)69
b(however)-13 b(,)68 b(always)63 b(accesses)h(the)166
6551 y(corr)m(ect)h(de\002nition)g(of)g Fp(make-promise)p
Ft(.)116 b(Similarly)-20 b(,)70 b(the)65 b Fp(case)h
Ft(macr)m(o)e(expands)h(into)g(uses)166 6776 y(of)d Fp(cond)p
Ft(,)68 b Fp(eqv?)p Ft(,)f(and)62 b(so)h(on.)108 b(These)63
b(names)f(ar)m(e)g(exported)h(by)f Fp(scheme)p Ft(,)67
b(but)62 b(their)h(corr)m(ect)166 7002 y(bindings)42
b(will)g(be)h(found)f(even)g(if)h(they)g(ar)m(e)f(shadowed)h(by)f
(de\002nitions)h(in)g(the)g(client)g(package.)166 7595
y Fm(4.5)238 b(Higher)l(-order)58 b(modules)166 8017
y Ft(Ther)m(e)36 b(ar)m(e)g Fp(define-module)h Ft(and)g
Fp(define)f Ft(forms)g(for)g(de\002ning)g(modules)g(that)g(ar)m(e)g
(intended)166 8243 y(to)55 b(be)f(instantiated)h(multiple)g(times.)84
b(But)54 b(these)h(ar)m(e)g(pr)m(etty)g(kludgey)f(\227)h(for)f
(example,)j(com-)166 8469 y(piled)e(code)f(isn't)g(shar)m(ed)g(between)
f(the)i(instantiations)f(\227)g(so)h(we)f(won't)g(describe)f(them)h
(yet.)166 8694 y(If)45 b(you)h(must)f(know)-17 b(,)46
b(\002gur)m(e)f(it)g(out)h(fr)m(om)e(the)i(following)f(grammar)-13
b(.)530 9048 y Fl(h)p Ft(de\002nition)p Fl(i)45 b(\000)-30
b(!)91 b Fp(\(define-module)110 b(\()p Fl(h)p Ft(name)p
Fl(i)e Fp(\()p Fl(h)p Ft(name)p Fl(i)g(h)p Ft(interface)p
Fl(i)n Fp(\))6075 8982 y Fj(\003)6154 9048 y Fp(\))2103
9273 y Fl(h)p Ft(de\002nition)p Fl(i)3028 9207 y Fj(\003)2103
9499 y Fl(h)p Ft(name)p Fl(i)o Fp(\))1743 9725 y Fl(j)91
b Fp(\(define)109 b Fl(h)p Ft(name)p Fl(i)f Fp(\()p Fl(h)p
Ft(name)p Fl(i)g(h)p Ft(name)p Fl(i)4842 9659 y Fj(\003)4921
9725 y Fp(\)\))166 10318 y Fm(4.6)238 b(Compiling)58
b(and)h(linking)166 10740 y Ft(Scheme)42 b(48)h(has)g(a)f(static)h
(linker)f(that)h(pr)m(oduces)g(stand-alone)f(heap)h(images)f(fr)m(om)g
(module)g(de-)166 10966 y(scriptions.)75 b(The)52 b(pr)m(ogrammer)e
(speci\002es)i(a)g(particular)e(pr)m(ocedur)m(e)h(in)g(a)h(particular)e
(str)o(uctur)m(e)166 11191 y(to)60 b(be)g(the)g(image's)e(startup)i(pr)
m(ocedur)m(e)f(\(entry)h(point\),)k(and)59 b(the)h(linker)f(traces)h
(dependency)166 11417 y(links)44 b(as)h(given)f(by)g
Fp(open)h Ft(and)f Fp(access)h Ft(clauses)f(to)h(determine)f(the)g
(composition)h(of)f(the)h(heap)166 11643 y(image.)3495
12141 y(21)p eop end
%%Page: 22 30
TeXDict begin 22 29 bop 614 1146 a Ft(Ther)m(e)41 b(is)f(not)h(curr)m
(ently)e(any)i(pr)m(ovision)f(for)g(separate)h(compilation;)h(the)f
(only)g(input)f(to)h(the)332 1372 y(static)64 b(linker)e(is)i(sour)m
(ce)e(code.)111 b(However)-13 b(,)67 b(it)d(will)e(not)i(be)f(dif)m
(\002cult)f(to)i(implement)f(separate)332 1597 y(compilation.)i(The)49
b(unit)e(of)i(compilation)f(is)g(one)g(module)g(\(not)g(one)g
(\002le\).)65 b(Any)49 b(opened)g(or)f(ac-)332 1823 y(cessed)i(str)o
(uctur)m(es)f(fr)m(om)g(which)g(macr)m(os)g(ar)m(e)h(obtained)g(must)f
(be)h(pr)m(ocessed)g(to)h(the)f(extent)g(of)332 2049
y(extracting)e(its)g(macr)m(o)g(de\002nitions.)65 b(The)48
b(compiler)g(knows)g(fr)m(om)f(the)h(interface)g(of)g(an)f(opened)332
2275 y(or)61 b(accessed)g(str)o(uctur)m(e)e(which)h(of)g(its)h(exports)
h(ar)m(e)e(macr)m(os.)102 b(Except)61 b(for)g(macr)m(os,)j(a)d(module)
332 2501 y(may)40 b(be)h(compiled)f(without)h(any)f(knowledge)h(of)f
(the)h(implementation)g(of)f(its)h(opened)g(and)g(ac-)332
2726 y(cessed)e(str)o(uctur)m(es.)54 b(However)-13 b(,)40
b(inter)m(-module)e(optimization)h(may)g(be)f(available)g(as)h(an)g
(option.)614 2958 y(The)58 b(main)f(dif)m(\002culty)f(with)i(separate)g
(compilation)f(is)h(r)m(esolution)f(of)g(auxiliary)g(bindings)332
3183 y(intr)m(oduced)48 b(into)g(macr)m(o)f(expansions.)65
b(The)48 b(module)g(compiler)g(must)f(transmit)h(to)h(the)f(loader)332
3409 y(or)e(linker)g(the)h(sear)m(ch)e(path)i(by)f(which)f(such)h
(bindings)f(ar)m(e)h(to)h(be)f(r)m(esolved.)59 b(In)46
b(the)h(case)f(of)g(the)332 3635 y Fp(delay)65 b Ft(macr)m(o's)f
(auxiliary)g Fp(make-promise)h Ft(\(see)g(example)f(above\),)70
b(the)65 b(loader)g(or)f(linker)332 3861 y(needs)73 b(to)f(know)h(that)
f(the)h(desir)m(ed)f(binding)f(of)h Fp(make-promise)i
Ft(is)e(the)h(one)f(appar)m(ent)g(in)332 4087 y Fp(delay)p
Ft('s)46 b(de\002ning)f(package,)h(not)g(in)f(the)h(package)f(being)g
(loaded)h(or)f(linked.)332 4717 y Fm(4.7)238 b(Semantics)58
b(of)i(con\002guration)f(mutation)332 5150 y Ft(During)54
b(pr)m(ogram)g(development)h(it)g(is)g(often)g(desirable)f(to)h(make)g
(changes)f(to)h(packages)g(and)332 5376 y(interfaces.)h(In)46
b(static)f(languages)g(it)g(may)g(be)g(necessary)g(to)h(r)m(ecompile)f
(and)g(r)m(e-link)f(a)i(pr)m(ogram)332 5602 y(in)37 b(or)m(der)h(for)f
(such)f(changes)h(to)h(be)g(r)m(e\003ected)f(in)g(a)g(r)o(unning)f
(system.)54 b(Even)38 b(in)f(interactive)g(Com-)332 5827
y(mon)53 b(Lisp)g(implementations,)i(a)e(change)g(to)g(a)g(package's)g
(exports)h(often)f(r)m(equir)m(es)e(r)m(eloading)332
6053 y(clients)61 b(that)h(have)e(alr)m(eady)h(mentioned)g(names)g
(whose)g(bindings)f(change.)104 b(Once)60 b Fp(read)i
Ft(r)m(e-)332 6279 y(solves)41 b(a)h(use)f(of)g(a)g(name)f(to)i(a)f
(symbol,)h(that)g(r)m(esolution)f(is)g(\002xed,)h(so)g(a)f(change)g(in)
g(the)g(way)g(that)332 6505 y(a)k(name)g(r)m(esolves)h(to)g(a)f(symbol)
g(can)g(only)g(be)g(r)m(e\003ected)g(by)g(r)m(e-)p Fp(read)p
Ft(ing)g(all)g(such)g(r)m(efer)m(ences.)614 6736 y(The)65
b(Scheme)f(48)g(development)g(envir)m(onment)f(supports)i(rapid)f
(turnar)m(ound)f(in)h(modu-)332 6962 y(lar)d(pr)m(ogram)g(development)h
(by)f(allowing)g(mutations)g(to)h(a)f(pr)m(ogram's)g(con\002guration,)k
(and)332 7188 y(giving)42 b(a)g(clear)f(semantics)g(to)i(such)e
(mutations.)56 b(The)42 b(r)o(ule)f(is)h(that)g(variable)f(bindings)g
(in)h(a)g(r)o(un-)332 7414 y(ning)53 b(pr)m(ogram)g(ar)m(e)g(always)g
(r)m(esolved)g(accor)m(ding)f(to)i(curr)m(ent)e(str)o(uctur)m(e)g(and)i
(interface)e(bind-)332 7639 y(ings,)62 b(even)c(when)f(these)i
(bindings)e(change)h(as)g(a)g(r)m(esult)g(of)g(edits)g(to)h(the)f
(con\002guration.)95 b(For)332 7865 y(example,)46 b(consider)f(the)h
(following:)663 8267 y Fp(\(define-interface)110 b(foo-interface)h
(\(export)e(a)h(c\)\))663 8499 y(\(define-structure)g(foo)g
(foo-interface)881 8730 y(\(open)g(scheme\))881 8961
y(\(begin)g(\(define)f(a)h(1\))1645 9192 y(\(define)f(\(b)h(x\))f(\(+)g
(a)g(x\)\))1645 9424 y(\(define)g(\(c)h(y\))f(\(*)g(\(b)g(a\))h
(y\)\)\)\))663 9655 y(\(define-structure)g(bar)g(\(export)g(d\))881
9886 y(\(open)g(scheme)f(foo\))881 10117 y(\(begin)h(\(define)f(\(d)h
(w\))f(\(+)g(\(b)g(w\))h(a\)\)\)\))332 10514 y Ft(This)59
b(pr)m(ogram)f(has)h(a)f(bug.)96 b(The)59 b(variable)f
Fp(b)p Ft(,)63 b(which)57 b(is)i(fr)m(ee)f(in)g(the)h(de\002nition)g
(of)g Fp(d)p Ft(,)j(has)d(no)332 10740 y(binding)52 b(in)h
Fp(bar)p Ft('s)g(package.)79 b(Suppose)55 b(that)e Fp(b)g
Ft(was)g(supposed)g(to)h(be)f(exported)g(by)g Fp(foo)p
Ft(,)j(but)332 10966 y(was)49 b(omitted)h(fr)m(om)f Fp(foo-interface)h
Ft(by)f(mistake.)69 b(It)50 b(is)g(not)g(necessary)f(to)h(r)m(e-pr)m
(ocess)f Fp(bar)332 11191 y Ft(or)60 b(any)h(of)f Fp(foo)p
Ft('s)g(other)g(clients)h(at)f(this)g(point.)102 b(One)60
b(need)h(only)f(change)g Fp(foo-interface)332 11417 y
Ft(and)45 b(inform)g(the)g(development)h(system)g(of)f(that)h(change)f
(\(using,)g(say)-20 b(,)46 b(an)f(appr)m(opriate)h(Emacs)332
11643 y(command\),)e(and)i Fp(foo)p Ft('s)f(binding)g(of)g
Fp(b)h Ft(will)e(be)h(found)g(when)g(pr)m(ocedur)m(e)g
Fp(d)g Ft(is)h(called.)3661 12141 y(22)p eop end
%%Page: 23 31
TeXDict begin 23 30 bop 448 1146 a Ft(Similarly)-20 b(,)57
b(it)d(is)g(also)h(possible)f(to)h(r)m(eplace)f(a)g(str)o(uctur)m(e;)k
(clients)c(of)g(the)g(old)h(str)o(uctur)m(e)e(will)166
1372 y(be)41 b(modi\002ed)h(so)g(that)g(they)g(see)f(bindings)g(fr)m
(om)g(the)g(new)h(one.)55 b(Shadowing)42 b(is)f(also)h(supported)166
1597 y(in)50 b(the)h(same)f(way)-20 b(.)71 b(Suppose)52
b(that)e(a)h(client)f(package)g Fh(C)64 b Ft(opens)51
b(a)f(str)o(uctur)m(e)f Fp(foo)i Ft(that)f(exports)166
1823 y(a)42 b(name)g Fp(x)p Ft(,)i(and)e Fp(foo)p Ft('s)g
(implementation)g(obtains)g(the)h(binding)e(of)h Fp(x)h
Ft(as)f(an)g(import)h(fr)m(om)e(some)166 2049 y(other)51
b(str)o(uctur)m(e)e Fp(bar)p Ft(.)72 b(Then)51 b Fh(C)63
b Ft(will)50 b(see)g(the)h(binding)f(fr)m(om)f Fp(bar)p
Ft(.)72 b(If)50 b(one)h(then)f(alters)h Fp(foo)g Ft(so)166
2275 y(that)f(it)f(shadows)h Fp(bar)p Ft('s)f(binding)g(of)g
Fp(x)g Ft(with)g(a)h(de\002nition)f(of)g(its)h(own,)h(then)e(pr)m
(ocedur)m(es)g(in)g Fh(C)166 2501 y Ft(that)60 b(r)m(efer)m(ence)e
Fp(x)i Ft(will)f(automatically)g(see)h Fp(foo)p Ft('s)g(de\002nition)g
(instead)g(of)f(the)h(one)g(fr)m(om)f Fp(bar)166 2726
y Ft(that)46 b(they)f(saw)h(earlier)-13 b(.)448 2957
y(This)74 b(semantics)g(might)f(appear)i(to)f(r)m(equir)m(e)f(a)g(lar)m
(ge)h(amount)f(of)h(computation)g(on)g(ev-)166 3183 y(ery)53
b(variable)g(r)m(efer)m(ence:)71 b(The)53 b(speci\002ed)h(behavior)e(r)
m(equir)m(es)h(scanning)f(the)i(package's)f(list)g(of)166
3408 y(opened)f(str)o(uctur)m(es,)f(examining)f(their)h(interfaces,)h
(on)f(every)f(variable)g(r)m(efer)m(ence,)h(not)g(just)g(at)166
3634 y(compile)39 b(time.)55 b(However)-13 b(,)40 b(the)g(development)f
(envir)m(onment)g(uses)g(caching)g(with)g(cache)f(inval-)166
3860 y(idation)46 b(to)g(make)f(variable)f(r)m(efer)m(ences)g(fast.)166
4485 y Fm(4.8)238 b(Command)58 b(processor)i(support)166
4917 y Ft(While)66 b(it)g(is)h(possible)f(to)h(use)f(the)h(Scheme)f(48)
g(static)g(linker)g(for)g(pr)m(ogram)g(development,)72
b(it)166 5142 y(is)64 b(far)g(mor)m(e)g(convenient)g(to)g(use)g(the)h
(development)f(envir)m(onment,)69 b(which)63 b(supports)i(rapid)166
5368 y(turnar)m(ound)59 b(for)i(pr)m(ogram)f(changes.)102
b(The)61 b(pr)m(ogrammer)e(interacts)i(with)f(the)h(development)166
5594 y(envir)m(onment)54 b(thr)m(ough)g(a)h Fs(command)g(pr)m(ocessor)p
Ft(.)82 b(The)56 b(command)d(pr)m(ocessor)i(is)g(like)g(the)g(usual)166
5820 y(Lisp)63 b(r)m(ead-eval-print)d(loop)j(in)f(that)h(it)f(accepts)h
(Scheme)f(forms)f(to)i(evaluate.)107 b(However)-13 b(,)66
b(all)166 6046 y(meta-level)43 b(operations,)i(such)e(as)g(exiting)h
(the)g(Scheme)f(system)h(or)f(r)m(equests)h(for)f(trace)g(output,)166
6272 y(ar)m(e)j(handled)g(by)f Fs(commands,)i Ft(which)e(ar)m(e)h
(lexically)g(distinguished)g(fr)m(om)f(Scheme)h(forms.)58
b(This)166 6497 y(arrangement)35 b(is)h(borr)m(owed)g(fr)m(om)e(the)j
(Symbolics)e(Lisp)i(Machine)e(system,)j(and)e(is)g(r)m(eminiscent)166
6723 y(of)54 b(non-Lisp)g(debuggers.)83 b(Commands)54
b(ar)m(e)g(a)g(little)h(easier)f(to)h(type)g(than)f(Scheme)g(forms)f
(\(no)166 6949 y(par)m(entheses,)h(so)e(you)f(don't)h(have)f(to)h
(shift\),)g(but)f(mor)m(e)g(importantly)-20 b(,)54 b(making)d(them)g
(distinct)166 7175 y(fr)m(om)66 b(Scheme)i(forms)e(ensur)m(es)h(that)h
(pr)m(ograms')f(namespaces)g(ar)m(en't)f(clutter)m(ed)h(with)h(inap-)
166 7401 y(pr)m(opriate)57 b(bindings.)91 b(Equivalently)-20
b(,)59 b(the)e(command)f(set)h(is)g(available)f(for)g(use)h(r)m(egar)m
(dless)f(of)166 7626 y(what)51 b(bindings)f(happen)h(to)g(be)g(visible)
f(in)h(the)g(curr)m(ent)e(pr)m(ogram.)73 b(This)51 b(is)g(especially)g
(impor)m(-)166 7852 y(tant)c(in)g(conjunction)e(with)h(the)h(module)g
(system,)g(which)f(puts)h(strict)g(contr)m(ols)f(on)h(visibility)f(of)
166 8078 y(bindings.)448 8308 y(The)g(Scheme)f(48)g(command)f(pr)m
(ocessor)h(supports)h(the)f(module)g(system)g(with)g(a)g(variety)g(of)
166 8534 y(special)54 b(commands.)80 b(For)54 b(commands)e(that)i(r)m
(equir)m(e)f(str)o(uctur)m(e)f(names,)k(these)e(names)f(ar)m(e)g(r)m
(e-)166 8760 y(solved)42 b(in)f(a)h(designated)g(con\002guration)f
(package)h(that)g(is)f(distinct)h(fr)m(om)f(the)g(curr)m(ent)g(package)
166 8986 y(for)j(evaluating)g(Scheme)g(forms)g(given)g(to)i(the)e
(command)g(pr)m(ocessor)-13 b(.)56 b(The)45 b(command)f(pr)m(oces-)166
9212 y(sor)i(interpr)m(ets)g(Scheme)g(forms)f(in)g(a)h(particular)f
(curr)m(ent)g(package,)h(and)g(ther)m(e)g(ar)m(e)f(commands)166
9438 y(that)h(move)f(the)g(command)g(pr)m(ocessor)g(between)g(dif)m
(fer)m(ent)g(packages.)448 9668 y(Commands)54 b(ar)m(e)g(intr)m(oduced)
g(by)g(a)h(comma)e(\()p Fp(,)p Ft(\))j(and)f(end)f(at)h(the)f(end)h(of)
f(line.)84 b(The)55 b(com-)166 9894 y(mand)f(pr)m(ocessor)13
b('s)54 b(pr)m(ompt)h(consists)f(of)g(the)h(name)e(of)h(the)h(curr)m
(ent)e(package)h(followed)g(by)g(a)166 10120 y(gr)m(eater)m(-than)44
b(\()p Fp(>)p Ft(\).)257 10568 y Fp(,open)109 b Fs(structur)m(e)1590
10502 y Fj(\003)621 10793 y Ft(The)72 b Fp(,open)g Ft(command)f(opens)i
(new)f(str)o(uctur)m(es)e(in)i(the)g(curr)m(ent)f(package,)79
b(as)72 b(if)g(the)621 11019 y(package's)63 b(de\002nition's)g
Fp(open)g Ft(clause)g(had)g(listed)h Fs(structur)m(e)p
Ft(.)108 b(As)64 b(with)f Fp(open)h Ft(clauses)621 11245
y(the)45 b(visible)g(names)g(can)g(be)g(modi\002ed,)h(as)f(in)951
11643 y Fp(,open)110 b(\(subset)g(foo)f(\(bar)g(baz\)\))3495
12141 y Ft(23)p eop end
%%Page: 24 32
TeXDict begin 24 31 bop 787 1146 a Ft(which)44 b(only)i(makes)f(the)g
Fp(bar)h Ft(and)f Fp(baz)h Ft(bindings)f(fr)m(om)f(str)o(uctur)m(e)g
Fp(foo)i Ft(visible.)423 1563 y Fp(,config)787 1789 y
Ft(The)65 b Fp(,config)g Ft(command)e(sets)i(the)g(command)e(pr)m
(ocessor)13 b('s)65 b(curr)m(ent)f(package)g(to)h(be)787
2015 y(the)40 b(curr)m(ent)f(con\002guration)h(package.)55
b(Forms)40 b(enter)m(ed)g(at)g(this)g(point)h(ar)m(e)f(interpr)m(eted)g
(as)787 2241 y(being)45 b(con\002guration)g(language)f(forms,)i(not)f
(Scheme)h(forms.)423 2659 y Fp(,config)110 b Fs(command)787
2885 y Ft(This)51 b(form)e(of)i(the)g Fp(,config)g Ft(command)e
(executes)i(another)f(command)g(in)g(the)h(curr)m(ent)787
3110 y(con\002guration)45 b(package.)57 b(For)45 b(example,)1117
3539 y Fp(,config)110 b(,load)g(foo.scm)787 3957 y Ft(interpr)m(ets)66
b(con\002guration)g(language)g(forms)f(fr)m(om)h(the)g(\002le)h
Fp(foo.scm)g Ft(in)f(the)g(curr)m(ent)787 4182 y(con\002guration)45
b(package.)423 4600 y Fp(,config-package-is)111 b Fs(struct-name)787
4826 y Ft(The)39 b Fp(,config-package-is)i Ft(command)e(designates)h(a)
f(new)g(con\002guration)g(package)787 5052 y(for)45 b(use)h(by)f(the)h
Fp(,config)g Ft(command)f(and)g(r)m(esolution)h(of)g
Fs(struct-name)p Ft(s)e(for)h(other)h(com-)787 5278 y(mands)h(such)h
(as)g Fp(,in)g Ft(and)g Fp(,open)p Ft(.)66 b(See)49 b(Section)f(4.9)h
(for)f(information)f(on)h(making)g(new)787 5503 y(con\002guration)d
(packages.)423 5921 y Fp(,in)109 b Fs(struct-name)787
6147 y Ft(The)45 b Fp(,in)h Ft(command)e(moves)h(the)g(command)f(pr)m
(ocessor)h(to)h(a)f(speci\002ed)h(str)o(uctur)m(e's)d(un-)787
6373 y(derlying)i(package.)57 b(For)45 b(example:)1117
6801 y Fp(user>)110 b(,config)1117 7038 y(config>)g(\(define-structure)
h(foo)e(\(export)h(a\))2208 7274 y(\(open)g(scheme\)\))1117
7511 y(config>)g(,in)f(foo)1117 7747 y(foo>)h(\(define)g(a)f(13\))1117
7984 y(foo>)h(a)1117 8220 y(13)787 8638 y Ft(In)69 b(this)g(example)g
(the)h(command)e(pr)m(ocessor)h(starts)h(in)f(a)g(package)h(called)f
Fp(user)p Ft(,)76 b(but)787 8864 y(the)49 b Fp(,config)g
Ft(command)e(moves)i(it)g(into)g(the)g(con\002guration)f(package,)i
(which)d(has)i(the)787 9089 y(name)40 b Fp(config)p Ft(.)56
b(The)41 b Fp(define-structure)h Ft(form)e(binds,)i(in)e
Fp(config)p Ft(,)j(the)e(name)f Fp(foo)787 9315 y Ft(to)60
b(a)f(str)o(uctur)m(e)g(that)h(exports)g Fp(a)p Ft(.)100
b(Finally)-20 b(,)63 b(the)d(command)e Fp(,in)110 b(foo)60
b Ft(moves)f(the)h(com-)787 9541 y(mand)44 b(pr)m(ocessor)i(into)g(str)
o(uctur)m(e)e Fp(foo)p Ft('s)h(underlying)g(package.)787
9863 y(A)d(package's)g(body)h(isn't)f(executed)g(\(evaluated\))f(until)
h(the)g(package)h(is)f Fs(loaded)p Ft(,)g(which)f(is)787
10089 y(accomplished)j(by)i(the)f Fp(,load-package)i
Ft(command.)423 10507 y Fp(,in)109 b Fs(struct-name)f(command)787
10732 y Ft(This)36 b(form)f(of)h(the)h Fp(,in)f Ft(command)f(executes)h
(a)h(single)f(command)f(in)h(the)g(speci\002ed)h(pack-)787
10958 y(age)45 b(without)g(moving)g(the)h(command)e(pr)m(ocessor)i
(into)g(that)f(package.)57 b(Example:)1117 11387 y Fp(,in)110
b(mumble)f(\(cons)h(1)f(2\))1117 11623 y(,in)h(mumble)f(,trace)h(foo)
3661 12141 y Ft(24)p eop end
%%Page: 25 33
TeXDict begin 25 32 bop 257 1146 a Fp(,user)109 b([)p
Fs(command)p Fp(])621 1372 y Ft(This)59 b(is)f(similar)g(to)h(the)g
Fp(,config)g Ft(and)g Fp(,in)g Ft(commands.)95 b(It)59
b(moves)g(to)g(or)g(executes)f(a)621 1597 y(command)36
b(in)h(the)g(user)g(package)h(\(which)e(is)h(the)h(default)e(package)i
(when)f(the)g(Scheme)g(48)621 1823 y(command)44 b(pr)m(ocessor)i
(starts\).)257 2199 y Fp(,user-package-is)110 b Fs(name)621
2425 y Ft(The)53 b Fp(,user-package-is)h Ft(command)e(designates)h(a)g
(new)f(user)g(package)h(for)g(use)f(by)621 2650 y(the)45
b Fp(,user)h Ft(command.)257 3026 y Fp(,load-package)110
b Fs(struct-name)621 3252 y Ft(The)51 b Fp(,load-package)i
Ft(command)d(ensur)m(es)g(that)i(the)f(speci\002ed)h(str)o(uctur)m(e's)
d(underly-)621 3478 y(ing)54 b(package's)h(pr)m(ogram)f(has)h(been)g
(loaded.)85 b(This)56 b(consists)f(of)g(\(1\))f(r)m(ecursively)f(ensur)
m(-)621 3703 y(ing)45 b(that)g(the)g(packages)h(of)f(any)g(opened)g(or)
h(accessed)f(str)o(uctur)m(es)f(ar)m(e)g(loaded,)i(followed)621
3929 y(by)58 b(\(2\))f(executing)h(the)h(package's)f(body)h(as)f
(speci\002ed)h(by)f(its)h(de\002nition's)f Fp(begin)h
Ft(and)621 4155 y Fp(files)45 b Ft(forms.)257 4531 y
Fp(,reload-package)110 b Fs(struct-name)621 4756 y Ft(This)66
b(command)f(r)m(e-executes)g(the)h(str)o(uctur)m(e's)f(package's)g(pr)m
(ogram.)119 b(It)66 b(is)g(most)h(use-)621 4982 y(ful)54
b(if)h(the)h(pr)m(ogram)f(comes)g(fr)m(om)g(a)g(\002le)h(or)g(\002les,)
i(when)d(it)h(will)f(update)h(the)f(package's)621 5208
y(bindings)44 b(after)h(mutations)h(to)g(its)f(sour)m(ce)g(\002le.)257
5584 y Fp(,load)109 b Fs(\002lespec)f Fp(...)621 5810
y Ft(The)37 b Fp(,load)g Ft(command)e(executes)i(forms)f(fr)m(om)g(the)
g(speci\002ed)h(\002le)g(or)g(\002les)g(in)f(the)h(curr)m(ent)621
6035 y(package.)111 b Fp(,load)e Fs(\002lespec)62 b Ft(is)i(similar)e
(to)i Fp(\(load)110 b(")p Fs(\002lespec)p Fp("\))62 b
Ft(except)i(that)g(the)g(name)621 6261 y Fp(load)45 b
Ft(needn't)h(be)f(bound)f(in)i(the)f(curr)m(ent)g(package)g(to)h
(Scheme's)f Fp(load)h Ft(pr)m(ocedur)m(e.)257 6637 y
Fp(,for-syntax)110 b([)p Fs(command)p Fp(])621 6863 y
Ft(This)59 b(is)f(similar)g(to)h(the)g Fp(,config)g Ft(and)g
Fp(,in)g Ft(commands.)95 b(It)59 b(moves)g(to)g(or)g(executes)f(a)621
7088 y(command)53 b(in)i(the)g(curr)m(ent)f(package's)g(\223package)h
(for)g(syntax,\224)i(which)d(is)h(the)g(package)621 7314
y(in)45 b(which)f(the)i(forms)e Fh(f)66 b Ft(in)45 b
Fp(\(define-syntax)110 b Fs(name)f(f)p Fp(\))45 b Ft(ar)m(e)g
(evaluated.)257 7690 y Fp(,new-package)621 7916 y Ft(The)55
b Fp(,new-package)h Ft(command)f(cr)m(eates)g(a)g(new)f(package,)59
b(in)c(which)f(only)h(the)g(stan-)621 8141 y(dar)m(d)45
b(Scheme)g(bindings)g(ar)m(e)g(visible,)g(and)g(moves)g(the)h(command)e
(pr)m(ocessor)i(to)g(it.)257 8517 y Fp(,structure)110
b Fs(name)f(interface)621 8743 y Ft(The)56 b Fp(,structure)g
Ft(command)f(de\002nes)h Fs(name)g Ft(in)f(the)h(con\002guration)g
(package)f(to)i(be)e(a)621 8969 y(str)o(uctur)m(e)44
b(with)h(interface)f Fs(interface)f Ft(based)j(on)f(the)h(curr)m(ent)e
(package.)166 9566 y Fm(4.9)238 b(Con\002guration)58
b(packages)166 9989 y Ft(It)69 b(is)g(possible)g(to)h(set)f(up)g
(multiple)f(con\002guration)h(packages.)127 b(The)69
b(default)g(con\002guration)166 10214 y(package)46 b(opens)g(the)f
(following)g(str)o(uctur)m(es:)439 10590 y Fl(\017)91
b Fp(module-system)p Ft(,)85 b(which)75 b(exports)i Fp
(define-structure)h Ft(and)e(the)g(other)h(con\002g-)621
10816 y(uration)72 b(language)f(keywor)m(ds,)80 b(as)72
b(well)g(as)g(standar)m(d)g(types)h(and)g(type)g(constr)o(uctors)621
11042 y(\()p Fp(:syntax)p Ft(,)46 b Fp(:value)p Ft(,)g
Fp(proc)p Ft(,)g(etc.\).)439 11417 y Fl(\017)91 b Fp
(built-in-structures)p Ft(,)46 b(which)e(exports)h(str)o(uctur)m(es)e
(that)i(ar)m(e)e(built)h(into)h(the)f(initial)621 11643
y(Scheme)h(48)g(image;)g(these)h(include)f Fp(scheme)p
Ft(,)h Fp(threads)p Ft(,)h Fp(tables)p Ft(,)f(and)g Fp(records)p
Ft(.)3495 12141 y(25)p eop end
%%Page: 26 34
TeXDict begin 26 33 bop 605 1146 a Fl(\017)91 b Fp(more-structures)p
Ft(,)113 b(which)97 b(exports)h(additional)h(str)o(uctur)m(es)d(that)j
(ar)m(e)e(available)787 1372 y(in)118 b(the)h(development)f(envir)m
(onment.)275 b(A)119 b(complete)g(listing)f(can)g(be)g(found)g(in)787
1597 y(the)j(de\002nition)h(of)f Fp(more-structures-interface)j
Ft(at)e(the)g(end)f(of)g(the)h(\002le)787 1823 y Fp
(scheme/packages.scm)p Ft(.)332 2283 y(Note)46 b(that)g(it)g(does)g
(not)f(open)h Fp(scheme)p Ft(.)614 2530 y(Y)-17 b(ou)42
b(can)f(de\002ne)g(additional)h(con\002guration)e(packages)i(by)f
(making)f(a)i(package)f(that)h(opens)332 2756 y Fp(module-system)50
b Ft(and,)g(optionally)-20 b(,)51 b Fp(built-in-structures)p
Ft(,)h Fp(more-structures)p Ft(,)g(or)332 2981 y(other)46
b(str)o(uctur)m(es)e(that)i(export)g(str)o(uctur)m(es)e(and)h
(interfaces.)614 3228 y(For)h(example:)663 3709 y Fp(>)109
b(,config)h(\(define-structure)g(foo)g(\(export\))1972
3956 y(\(open)f(module-system)2626 4203 y(built-in-structures)2626
4450 y(more-structures\)\))663 4697 y(>)g(,in)g(foo)663
4944 y(foo>)g(\(define-structure)i(x)e(\(export)h(a)f(b\))1426
5191 y(\(open)h(scheme\))1426 5438 y(\(files)g(x\)\))663
5685 y(foo>)614 6144 y Ft(Unfortunately)-20 b(,)62 b(the)c(above)f
(example)h(does)g(not)g(work.)94 b(The)59 b(pr)m(oblem)e(is)h(that)g
(every)g(en-)332 6370 y(vir)m(onment)d(in)h(which)f Fp
(define-structure)j Ft(is)e(de\002ned)h(must)e(also)i(have)f(a)g(way)g
(to)g(cr)m(eate)332 6596 y(\223r)m(e\003ective)49 b(towers\224)h(\(a)g
(misnomer;)i(a)e(better)g(name)f(would)h(be)g(\223syntactic)g
(towers\224\).)70 b(A)51 b(new)332 6822 y(r)m(e\003ective)44
b(tower)g(is)h(r)m(equir)m(ed)e(whenever)h(a)g(new)g(envir)m(onment)g
(is)g(cr)m(eated)h(for)f(compiling)g(the)332 7047 y(sour)m(ce)f(code)g
(in)h(the)f(package)h(associated)f(with)g(a)h(new)f(str)o(uctur)m(e.)54
b(The)44 b(envir)m(onment's)e(tower)332 7273 y(is)k(used)f(at)h
(compile)f(time)g(for)g(evaluating)g(the)g Fs(macr)m(o-sour)m(ce)e
Ft(in)663 7754 y Fp(\(define-syntax)110 b Fs(name)f(macr)m(o-sour)m(ce)
p Fp(\))663 8001 y(\(let-syntax)h(\(\()p Fs(name)f(macr)m(o-sour)m(ce)p
Fp(\))e Fs(...)p Fp(\))j Fs(body)p Fp(\))332 8461 y Ft(and)49
b(so)h(forth.)68 b(It)50 b(is)f(a)h(\223tower)13 b(\224)49
b(because)g(that)g(envir)m(onment,)h(in)f(turn,)i(has)e(to)h(say)f
(what)g(envi-)332 8687 y(r)m(onment)c(to)h(use)f(if)g
Fp(macro-source)i Ft(itself)e(contains)g(a)h(use)f(of)g
Fp(let-syntax)p Ft(.)614 8933 y(The)57 b(simplest)f(way)g(to)h(pr)m
(ovide)f(a)g(tower)g(maker)g(is)g(to)h(pass)g(on)f(the)g(one)h(used)f
(by)g(an)g(ex-)332 9159 y(isting)70 b(con\002guration)e(package.)129
b(The)70 b(special)f(form)g Fp(export-reflective-tower)i
Ft(cr)m(e-)332 9385 y(ates)59 b(an)f(interface)f(that)i(exports)g(a)f
(con\002guration)g(package's)g(tower)-13 b(.)96 b(The)58
b(following)g(exam-)332 9611 y(ple)f(uses)g Fp(export-reflective-tower)
i Ft(and)e(the)g Fp(,structure)h Ft(command)e(to)h(obtain)g(a)332
9837 y(tower)46 b(maker)f(and)g(cr)m(eate)g(a)g(new)g(con\002guration)g
(envir)m(onment.)663 10388 y Fp(>)109 b(,config)h(,structure)g(t)f
(\(export-reflective-tower-maker\))663 10635 y(>)g(,config)h
(\(define-structure)g(foo)g(\(export\))1972 10882 y(\(open)f
(module-system)2626 11129 y(t)2626 11376 y(built-in-structures)2626
11623 y(more-structures\)\))3661 12141 y Ft(26)p eop
end
%%Page: 27 35
TeXDict begin 27 34 bop 166 1146 a Fm(4.10)238 b(Discussion)166
1589 y Ft(This)67 b(module)e(system)i(was)f(not)g(designed)h(as)f(the)h
(be-all)e(and)h(end-all)f(of)i(Scheme)f(module)166 1815
y(systems;)71 b(it)62 b(was)g(only)g(intended)g(to)h(help)f(us)f(or)m
(ganize)h(the)g(Scheme)g(48)g(system.)106 b(Not)63 b(only)166
2040 y(does)49 b(the)g(module)f(system)g(help)h(avoid)f(name)g(clashes)
g(by)g(keeping)h(dif)m(fer)m(ent)e(subsystems)h(in)166
2266 y(dif)m(fer)m(ent)j(namespaces,)j(it)f(has)f(also)g(helped)h(us)f
(to)h(tighten)f(up)g(and)h(generalize)f(Scheme)g(48's)166
2492 y(internal)j(interfaces.)87 b(Scheme)56 b(48)g(is)f(unusual)g
(among)g(Lisp)h(implementations)g(in)f(admitting)166
2718 y(many)64 b(dif)m(fer)m(ent)g(possible)h(modes)g(of)g(operation.)
116 b(Examples)65 b(of)g(such)f(multiple)h(modes)g(in-)166
2944 y(clude)45 b(the)h(following:)439 3361 y Fl(\017)91
b Ft(Linking)45 b(can)g(be)g(either)g(static)h(or)f(dynamic.)439
3778 y Fl(\017)91 b Ft(The)60 b(development)g(envir)m(onment)f
(\(compiler)-13 b(,)63 b(debugger)-13 b(,)63 b(and)d(command)f(pr)m
(ocessor\))621 4003 y(can)50 b(r)o(un)g(either)i(in)e(the)i(same)f
(addr)m(ess)g(space)g(as)g(the)h(pr)m(ogram)e(being)h(developed)h(or)f
(in)621 4229 y(a)46 b(dif)m(fer)m(ent)f(addr)m(ess)i(space.)60
b(The)47 b(envir)m(onment)e(and)h(user)g(pr)m(ogram)g(may)g(even)h(r)o
(un)e(on)621 4455 y(dif)m(fer)m(ent)f(pr)m(ocessors)h(under)g(dif)m
(fer)m(ent)f(operating)i(systems[8].)439 4872 y Fl(\017)91
b Ft(The)59 b(virtual)g(machine)f(can)h(be)g(supported)h(by)f(either)h
(of)f(two)g(implementations)h(of)f(its)621 5098 y(implementation)45
b(language,)g(Pr)m(escheme.)166 5515 y(The)51 b(module)f(system)h(has)g
(been)f(helpful)g(in)g(or)m(ganizing)g(these)h(multiple)g(modes.)72
b(By)51 b(for)m(cing)166 5740 y(us)41 b(to)i(write)e(down)h(interfaces)
f(and)g(module)g(dependencies,)i(the)f(module)f(system)h(helps)g(us)f
(to)166 5966 y(keep)46 b(the)g(system)f(clean,)h(or)f(at)h(least)g(to)g
(keep)g(us)f(honest)h(about)f(how)g(clean)g(or)g(not)h(it)g(is.)448
6203 y(The)61 b(need)g(to)g(make)f(str)o(uctur)m(es)g(and)g(interfaces)
g(second-class)g(instead)g(of)h(\002rst-class)f(r)m(e-)166
6428 y(sults)69 b(fr)m(om)g(the)g(r)m(equir)m(ements)f(of)h(static)g
(pr)m(ogram)g(analysis:)104 b(it)70 b(must)f(be)f(possible)i(for)f(the)
166 6654 y(compiler)56 b(and)h(linker)f(to)h(expand)g(macr)m(os)f(and)g
(r)m(esolve)g(variable)g(bindings)g(befor)m(e)g(the)g(pr)m(o-)166
6880 y(gram)i(is)g(executed.)95 b(Str)o(uctur)m(es)58
b(could)g(be)g(made)g(\002rst-class)g(\(as)f(in)h(FX[9]\))g(if)g(a)g
(type)h(system)166 7106 y(wer)m(e)52 b(added)h(to)g(Scheme)f(and)g(the)
h(de\002nitions)g(of)f(exported)h(macr)m(os)f(wer)m(e)g(de\002ned)h(in)
f(inter)m(-)166 7332 y(faces)60 b(instead)g(of)g(in)g(module)f(bodies,)
65 b(but)59 b(even)h(in)g(that)g(case)g(types)h(and)f(interfaces)f
(would)166 7557 y(r)m(emain)44 b(second-class.)448 7794
y(The)63 b(pr)m(ohibition)f(on)h(assignment)f(to)i(imported)e(bindings)
g(makes)h(substitution)f(a)h(valid)166 8020 y(optimization)40
b(when)e(a)i(module)f(is)g(compiled)g(as)h(a)f(block.)55
b(The)39 b(block)g(compiler)g(\002rst)h(scans)f(the)166
8245 y(entir)m(e)53 b(module)g(body)-20 b(,)56 b(noting)e(which)e
(variables)g(ar)m(e)h(assigned.)81 b(Those)55 b(that)e(ar)m(en't)g
(assigned)166 8471 y(\(only)f Fp(define)p Ft(d\))g(may)g(be)g(assumed)f
(never)h(assigned,)i(even)e(if)g(they)g(ar)m(e)g(exported.)77
b(The)53 b(op-)166 8697 y(timizer)i(can)g(then)g(perform)g(a)h(very)f
(simple-minded)f(analysis)i(to)g(determine)f(automatically)166
8923 y(that)46 b(some)f(pr)m(ocedur)m(es)g(can)g(and)g(should)g(have)g
(their)h(calls)f(compiled)g(in)g(line.)448 9159 y(The)57
b(pr)m(ogramming)e(style)h(encouraged)g(by)g(the)g(module)f(system)i
(is)f(consistent)g(with)g(the)166 9385 y(unextended)79
b(Scheme)g(language.)156 b(Because)79 b(module)f(system)i(featur)m(es)e
(do)h(not)g(generally)166 9611 y(show)54 b(up)f(within)g(module)h
(bodies,)i(an)d(individual)g(module)g(may)h(be)f(understood)h(by)g
(some-)166 9836 y(one)k(who)f(is)g(not)g(familiar)f(with)h(the)h
(module)e(system.)93 b(This)57 b(is)h(a)f(gr)m(eat)g(aid)g(to)h(code)g
(pr)m(esen-)166 10062 y(tation)51 b(and)g(portability)-20
b(.)74 b(If)51 b(a)f(few)h(simple)g(conditions)g(ar)m(e)f(met)h(\(no)g
(name)f(con\003icts)h(between)166 10288 y(packages,)61
b(and)c(use)g(of)g Fp(files)g Ft(in)g(pr)m(efer)m(ence)f(to)i
Fp(begin)p Ft(\),)j(then)c(a)g(multi-module)f(pr)m(ogram)166
10514 y(can)g(be)g(loaded)h(into)g(a)g(Scheme)f(implementation)g(that)h
(does)g(not)g(support)g(the)g(module)f(sys-)166 10740
y(tem.)96 b(The)59 b(Scheme)g(48)f(static)h(linker)f(satis\002es)h
(these)g(conditions,)k(and)58 b(can)g(ther)m(efor)m(e)g(r)o(un)f(in)166
10966 y(other)70 b(Scheme)f(implementations.)128 b(Scheme)69
b(48's)g(bootstrap)h(pr)m(ocess,)75 b(which)69 b(is)g(based)g(on)166
11191 y(the)46 b(static)f(linker)-13 b(,)46 b(is)f(ther)m(efor)m(e)g
(nonincestuous.)56 b(This)46 b(contrasts)g(with)f(most)h(other)g
(integrated)166 11417 y(pr)m(ogramming)41 b(envir)m(onments,)h(such)f
(as)g(Smalltalk-80,)i(wher)m(e)d(the)i(system)g(can)g(only)f(be)h
(built)166 11643 y(using)j(an)g(existing)h(version)f(of)g(the)h(system)
f(itself.)3495 12141 y(27)p eop end
%%Page: 28 36
TeXDict begin 28 35 bop 614 1146 a Ft(Like)47 b(ML)g(modules,)g(but)g
(unlike)f(Scheme)g(Xer)m(ox)h(modules,)g(this)g(module)f(system)h(is)g
(com-)332 1372 y(positional.)88 b(That)56 b(is,)j(str)o(uctur)m(es)c
(ar)m(e)g(constr)o(ucted)g(by)g(single)h(syntactic)f(units)h(that)g
(compose)332 1597 y(existing)48 b(str)o(uctur)m(es)e(with)h(a)h(body)f
(of)h(code.)63 b(In)48 b(Scheme)g(Xer)m(ox,)g(the)g(set)g(of)f(modules)
h(that)g(can)332 1823 y(contribute)38 b(to)h(an)f(interface)g(is)g
(open-ended)h(\227)f(any)h(module)f(can)g(contribute)f(bindings)h(to)h
(any)332 2049 y(interface)53 b(whose)h(name)f(is)h(in)f(scope.)82
b(The)54 b(module)g(system)g(implementation)f(is)h(a)g(cr)m(oss-bar)332
2275 y(that)59 b(channels)f(de\002nitions)i(fr)m(om)d(modules)i(to)g
(interfaces.)97 b(The)59 b(module)g(system)g(described)332
2501 y(her)m(e)47 b(has)g(simpler)g(semantics)g(and)g(makes)g
(dependencies)h(easier)f(to)h(trace.)62 b(It)48 b(also)f(allows)g(for)
332 2726 y(higher)m(-or)m(der)d(modules,)i(which)e(Scheme)h(Xer)m(ox)h
(considers)f(unimportant.)3661 12141 y(28)p eop end
%%Page: 29 37
TeXDict begin 29 36 bop 166 2391 a Fo(Chapter)87 b(5)166
3221 y Fr(Libraries)166 4111 y Ft(Use)56 b(the)g Fp(,open)g
Ft(command)e(\(section)h(3.4\))g(or)h(the)g(module)f(language)f
(\(chapter)h(2.6\))h(to)g(open)166 4337 y(the)46 b(str)o(uctur)m(es)e
(described)h(below)-17 b(.)166 4932 y Fm(5.1)238 b(General)58
b(utilities)166 5354 y Ft(These)46 b(ar)m(e)f(in)g(the)h
Fp(big-util)g Ft(str)o(uctur)m(e.)202 5684 y Fl(\017)91
b Fp(\(atom?)103 b Fs(value)p Fp(\))90 b Fl(!)g Fs(boolean)166
6014 y Fp(\(atom?)219 b Fs(x)p Fp(\))45 b Ft(is)h(the)f(same)g(as)h
Fp(\(not)109 b(\(pair?)219 b Fs(x)p Fp(\)\))p Ft(.)202
6344 y Fl(\017)91 b Fp(\(null-list?)103 b Fs(list)p Fp(\))89
b Fl(!)i Fs(boolean)166 6674 y Ft(Returns)46 b(tr)o(ue)e(for)i(the)f
(empty)h(list,)g(false)f(for)g(a)g(pair)-13 b(,)46 b(and)f(signals)g
(an)h(err)m(or)f(otherwise.)202 7004 y Fl(\017)91 b Fp(\(neq?)102
b Fs(value)90 b(value)p Fp(\))g Fl(!)h Fs(boolean)166
7334 y Fp(\(neq?)219 b Fs(x)109 b(y)p Fp(\))45 b Ft(is)h(the)f(same)g
(as)h Fp(\(not)109 b(\(eq?)219 b Fs(x)109 b(y)p Fp(\)\))p
Ft(.)202 7665 y Fl(\017)91 b Fp(\(n=)g Fs(number)h(number)p
Fp(\))f Fl(!)g Fs(boolean)166 7995 y Fp(\(n=)109 b Fs(x)g(y)p
Fp(\))46 b Ft(is)f(the)h(same)f(as)g Fp(\(not)110 b(\(=)f
Fs(x)g(y)p Fp(\)\))p Ft(.)202 8325 y Fl(\017)91 b Fp(\(identity)h
Fs(value)p Fp(\))e Fl(!)h Fs(value)202 8551 y Fl(\017)g
Fp(\(no-op)h Fs(value)p Fp(\))e Fl(!)g Fs(value)166 8881
y Ft(These)37 b(both)g(just)f(r)m(eturn)g(their)g(ar)m(gument.)53
b Fp(No-op)37 b Ft(is)g(guaranteed)f(not)h(to)g(be)f(compiled)h
(in-line,)166 9107 y Fp(identity)46 b Ft(may)f(be.)202
9437 y Fl(\017)91 b Fp(\(memq?)103 b Fs(value)89 b(list)p
Fp(\))h Fl(!)h Fs(boolean)166 9767 y Ft(Returns)46 b(tr)o(ue)e(if)h
Fs(value)g Ft(is)g(in)g Fs(list)o Ft(,)h(false)f(otherwise.)202
10097 y Fl(\017)91 b Fp(\(any?)102 b Fs(pr)m(edicate)89
b(list)p Fp(\))g Fl(!)i Fs(boolean)166 10427 y Ft(Returns)46
b(tr)o(ue)e(if)h Fs(pr)m(edicate)e Ft(is)j(tr)o(ue)f(for)g(any)g
(element)g(of)h Fs(list)n Ft(.)202 10757 y Fl(\017)91
b Fp(\(every?)103 b Fs(pr)m(edicate)88 b(list)p Fp(\))h
Fl(!)i Fs(boolean)166 11087 y Ft(Returns)46 b(tr)o(ue)e(if)h
Fs(pr)m(edicate)e Ft(is)j(tr)o(ue)f(for)g(every)g(element)g(of)h
Fs(list)n Ft(.)202 11417 y Fl(\017)91 b Fp(\(any)g Fs(pr)m(edicate)e
(list)p Fp(\))g Fl(!)i Fs(value)202 11643 y Fl(\017)g
Fp(\(first)h Fs(pr)m(edicate)c(list)p Fp(\))h Fl(!)i
Fs(value)3495 12141 y Ft(29)p eop end
%%Page: 30 38
TeXDict begin 30 37 bop 332 1146 a Fp(Any)53 b Ft(r)m(eturns)e(some)i
(element)f(of)g Fs(list)f Ft(for)h(which)f Fs(pr)m(edicate)f
Ft(is)i(tr)o(ue,)i(or)f(false)f(if)g(ther)m(e)g(ar)m(e)g(none.)332
1372 y Fp(First)43 b Ft(does)f(the)g(same)g(except)h(that)f(it)g(r)m
(eturns)f(the)i(\002rst)f(element)g(for)g(which)f Fs(pr)m(edicate)e
Ft(is)j(tr)o(ue.)368 1686 y Fl(\017)91 b Fp(\(filter)h
Fs(pr)m(edicate)c(list)p Fp(\))i Fl(!)g Fs(list)368 1912
y Fl(\017)h Fp(\(filter!)103 b Fs(pr)m(edicate)88 b(list)p
Fp(\))i Fl(!)g Fs(list)332 2226 y Ft(Returns)41 b(a)h(list)f
(containing)g(all)g(of)g(the)g(elements)g(of)g Fs(list)f
Ft(for)h(which)f Fs(pr)m(edicate)f Ft(is)i(tr)o(ue.)55
b(The)41 b(or)m(der)332 2452 y(of)k(the)h(elements)f(is)h(pr)m
(eserved.)56 b Fp(Filter!)h Ft(may)45 b(r)m(euse)g(the)h(storage)g(of)f
Fs(list)o Ft(.)368 2766 y Fl(\017)91 b Fp(\(filter-map)h
Fs(pr)m(ocedur)m(e)d(list)p Fp(\))g Fl(!)i Fs(list)332
3080 y Ft(The)41 b(same)g(as)g Fp(filter)h Ft(except)f(the)g(r)m
(eturned)f(list)h(contains)g(the)g(r)m(esults)g(of)g(applying)g
Fs(pr)m(ocedur)m(e)332 3306 y Ft(instead)54 b(of)f(elements)g(of)h
Fs(list)n Ft(.)81 b Fp(\(filter-map)110 b Fs(p)f(l)o
Fp(\))54 b Ft(is)f(the)h(same)f(as)h Fp(\(filter)109
b(identity)332 3532 y(\(map)h Fs(p)f(l)o Fp(\)\))p Ft(.)368
3846 y Fl(\017)91 b Fp(\(partition-list)i Fs(pr)m(edicate)88
b(list)p Fp(\))h Fl(!)i Fs(list)e(list)368 4072 y Fl(\017)i
Fp(\(partition-list!)104 b Fs(pr)m(edicate)88 b(list)p
Fp(\))h Fl(!)i Fs(list)e(list)332 4386 y Ft(The)83 b(\002rst)g(r)m
(eturn)f(value)g(contains)g(those)h(elements)g Fs(list)e
Ft(for)h(which)f Fs(pr)m(edicate)g Ft(is)h(tr)o(ue,)92
b(the)332 4612 y(second)77 b(contains)g(the)g(r)m(emaining)e(elements.)
151 b(The)77 b(or)m(der)g(of)f(the)h(elements)g(is)g(pr)m(eserved.)332
4838 y Fp(Partition-list!)58 b Ft(may)45 b(r)m(euse)g(the)g(storage)h
(of)g(the)f Fs(list)o Ft(.)368 5152 y Fl(\017)91 b Fp
(\(remove-duplicates)i Fs(list)p Fp(\))c Fl(!)i Fs(list)332
5466 y Ft(Returns)51 b(its)g(ar)m(gument)f(with)g(all)g(duplicate)h
(elements)g(r)m(emoved.)72 b(The)51 b(\002rst)g(instance)f(of)h(each)
332 5692 y(element)45 b(is)h(pr)m(eserved.)368 6006 y
Fl(\017)91 b Fp(\(delq)h Fs(value)e(list)p Fp(\))f Fl(!)i
Fs(list)368 6232 y Fl(\017)g Fp(\(delq!)103 b Fs(value)90
b(list)p Fp(\))f Fl(!)i Fs(list)368 6458 y Fl(\017)g
Fp(\(delete)h Fs(pr)m(edicate)c(list)p Fp(\))i Fl(!)g
Fs(list)332 6772 y Ft(All)43 b(thr)m(ee)g(of)f(these)i(r)m(eturn)e
Fs(list)f Ft(with)h(some)h(elements)g(r)m(emoved.)55
b Fp(Delq)43 b Ft(r)m(emoves)g(all)f(elements)332 6998
y Fp(eq?)124 b Ft(to)68 b Fs(value)o Ft(.)124 b Fp(Delq!)g
Ft(does)68 b(the)g(same)g(and)f(may)h(modify)f(the)h(list)g(ar)m
(gument.)123 b Fp(Delete)332 7223 y Ft(r)m(emoves)58
b(all)h(elements)f(for)h(which)e Fs(pr)m(edicate)g Ft(is)h(tr)o(ue.)96
b(Both)59 b Fp(delq)h Ft(and)e Fp(delete)h Ft(may)g(r)m(euse)332
7449 y(some)46 b(of)f(the)g(storage)h(in)g(the)f(list)h(ar)m(gument,)f
(but)g(won't)g(modify)f(it.)368 7763 y Fl(\017)91 b Fp(\(reverse!)103
b Fs(list)p Fp(\))89 b Fl(!)i Fs(list)332 8078 y Ft(Destr)o(uctively)44
b(r)m(everses)h Fs(list)o Ft(.)368 8392 y Fl(\017)91
b Fp(\(concatenate-symbol)i Fs(value)d(.)27 b(.)g(.)g
Fp(\))104 b Fl(!)91 b Fs(symbol)332 8706 y Ft(Returns)44
b(the)f(symbol)g(whose)g(name)f(is)i(pr)m(oduced)f(by)g(concatenating)f
(the)i Fp(display)p Ft(ed)g(r)m(epr)m(e-)332 8932 y(sentations)i(of)f
Fs(value)g Ft(.)27 b(.)g(.)g(.)663 9324 y Fp(\(concatenate-symbol)111
b('abc)e("-")g(4\))h Fi(=)-30 b Fl(\))109 b Fp('abc-4)332
9915 y Fm(5.2)238 b(Pretty-printing)332 10337 y Ft(These)46
b(ar)m(e)f(in)g(the)h Fp(pp)g Ft(str)o(uctur)m(e.)368
10651 y Fl(\017)91 b Fp(\(p)g Fs(value)p Fp(\))368 10877
y Fl(\017)g Fp(\(p)g Fs(value)f(output-port)p Fp(\))368
11103 y Fl(\017)h Fp(\(pretty-print)h Fs(value)e(output-port)f
(position)p Fp(\))332 11417 y Ft(Pr)m(etty-print)44 b
Fs(value)f Ft(The)i(curr)m(ent)e(output)i(port)g(is)f(used)g(if)g(no)g
(port)h(is)g(speci\002ed.)56 b Fs(Position)43 b Ft(is)h(the)332
11643 y(starting)i(of)m(fset.)56 b Fs(V)-13 b(alue)44
b Ft(will)h(be)g(pr)m(etty-printed)h(to)g(the)g(right)f(of)g(this)h
(column.)3661 12141 y(30)p eop end
%%Page: 31 39
TeXDict begin 31 38 bop 166 1146 a Fm(5.3)238 b(ASCII)60
b(character)e(encoding)166 1568 y Ft(These)46 b(ar)m(e)f(in)g(the)h
(str)o(uctur)m(e)e Fp(ascii)p Ft(.)202 1884 y Fl(\017)91
b Fp(\(char->ascii)h Fs(char)p Fp(\))f Fl(!)f Fs(integer)202
2110 y Fl(\017)h Fp(\(ascii->char)h Fs(integer)p Fp(\))d
Fl(!)i Fs(char)166 2426 y Ft(These)38 b(ar)m(e)g(identical)f(to)i
Fp(char->integer)g Ft(and)f Fp(integer->char)h Ft(except)f(that)g(they)
g(use)g(the)166 2652 y(ASCII)47 b(encodingASCII)f(encoding)g
(\(appendix)f(A\).)202 2969 y Fl(\017)91 b Fp(ascii-limit)4858
b Ft(integer)202 3194 y Fl(\017)91 b Fp(ascii-whitespaces)3634
b Ft(list)46 b(of)f(integers)166 3511 y Fp(Ascii-limit)73
b Ft(is)f(one)g(mor)m(e)g(than)g(the)g(lar)m(gest)g(value)f(that)i
Fp(char->ascii)g Ft(may)e(r)m(eturn.)166 3737 y Fp(Ascii-whitespaces)63
b Ft(is)e(a)g(list)g(of)g(the)h(ASCII)g(values)f(of)g(whitespace)g
(characters)f(\(space,)166 3962 y(horizontal)45 b(tab,)h(line)f(feed)g
(\(=)h(newline\),)e(vertical)h(tab,)h(form)e(feed,)i(and)f(carriage)g
(r)m(eturn\).)166 4555 y Fm(5.4)238 b(Bitwise)59 b(integer)f
(operations)166 4977 y Ft(These)67 b(functions)f(use)h(the)g
(two's-complement)e(r)m(epr)m(esentation)i(for)g(integers.)120
b(Ther)m(e)67 b(is)g(no)166 5202 y(limit)h(to)h(the)f(number)f(of)h
(bits)g(in)g(an)g(integer)-13 b(.)125 b(They)68 b(ar)m(e)g(in)g(the)g
(str)o(uctur)m(es)f Fp(bitwise)i Ft(and)166 5428 y Fp(big-scheme)p
Ft(.)202 5745 y Fl(\017)91 b Fp(\(bitwise-and)h Fs(integer)d(integer)p
Fp(\))h Fl(!)g Fs(integer)202 5970 y Fl(\017)h Fp(\(bitwise-ior)h
Fs(integer)d(integer)p Fp(\))h Fl(!)g Fs(integer)202
6196 y Fl(\017)h Fp(\(bitwise-xor)h Fs(integer)d(integer)p
Fp(\))h Fl(!)g Fs(integer)202 6422 y Fl(\017)h Fp(\(bitwise-not)h
Fs(integer)p Fp(\))d Fl(!)i Fs(integer)166 6738 y Ft(These)66
b(perform)e(various)g(logical)h(operations)h(on)f(integers)g(on)g(a)g
(bit-by-bit)e(basis.)115 b(`)p Fp(ior)p Ft(')64 b(is)166
6964 y(inclusive)44 b(OR)i(and)f(`)p Fp(xor)p Ft(')g(is)h(exclusive)e
(OR.)202 7281 y Fl(\017)91 b Fp(\(arithmetic-shift)i
Fs(integer)c(bit-count)p Fp(\))g Fl(!)i Fs(integer)166
7597 y Ft(Shifts)64 b(the)g(integer)f(by)h(the)f(given)h(bit)f(count,)
68 b(which)63 b(must)g(be)g(an)h(integer)-13 b(,)68 b(shifting)63
b(left)g(for)166 7823 y(positive)46 b(counts)f(and)h(right)f(for)g
(negative)g(ones.)57 b(Shifting)46 b(pr)m(eserves)f(the)h(integer)13
b('s)45 b(sign.)202 8139 y Fl(\017)91 b Fp(\(bit-count)h
Fs(integer)p Fp(\))d Fl(!)i Fs(integer)166 8456 y Ft(Counts)39
b(the)g(number)f(of)h(bits)f(set)i(in)f(the)g(integer)-13
b(.)54 b(If)39 b(the)g(ar)m(gument)f(is)h(negative)g(a)g(bitwise)g(NOT)
166 8682 y(operation)46 b(is)g(performed)f(befor)m(e)f(counting.)166
9274 y Fm(5.5)238 b(Byte)59 b(vectors)166 9696 y Ft(These)80
b(ar)m(e)f(homogeneous)g(vectors)h(of)f(small)g(integers)g(\()p
Fi(0)113 b Fl(\024)h Fh(i)f Fl(\024)h Fi(255)p Ft(\).)158
b(The)80 b(functions)166 9922 y(that)68 b(operate)g(on)g(them)f(ar)m(e)
h(analogous)f(to)h(those)g(for)g(vectors.)123 b(They)68
b(ar)m(e)f(in)h(the)f(str)o(uctur)m(e)166 10147 y Fp(byte-vectors)p
Ft(.)202 10464 y Fl(\017)91 b Fp(\(byte-vector?)103 b
Fs(value)p Fp(\))90 b Fl(!)h Fs(boolean)202 10690 y Fl(\017)g
Fp(\(make-byte-vector)i Fs(k)d(\002ll)p Fp(\))g Fl(!)h
Fs(byte-vector)202 10915 y Fl(\017)g Fp(\(byte-vector)h
Fs(b)f(.)27 b(.)g(.)g Fp(\))104 b Fl(!)91 b Fs(byte-vector)202
11141 y Fl(\017)g Fp(\(byte-vector-length)i Fs(byte-vector)p
Fp(\))88 b Fl(!)j Fs(integer)202 11367 y Fl(\017)g Fp
(\(byte-vector-ref)i Fs(byte-vector)88 b(k)q Fp(\))j
Fl(!)f Fs(integer)202 11593 y Fl(\017)h Fp(\(byte-vector-set!)i
Fs(byte-vector)88 b(k)j(b)p Fp(\))3495 12141 y Ft(31)p
eop end
%%Page: 32 40
TeXDict begin 32 39 bop 332 1146 a Fm(5.6)238 b(Sparse)59
b(vectors)332 1584 y Ft(These)53 b(ar)m(e)f(vectors)g(that)g(gr)m(ow)g
(as)g(lar)m(ge)g(as)h(they)f(need)g(to.)78 b(That)53
b(is,)h(they)f(can)e(be)h(indexed)g(by)332 1809 y(arbitrarily)39
b(lar)m(ge)h(nonnegative)g(integers.)55 b(The)40 b(implementation)g
(allows)g(for)g(arbitrarily)f(lar)m(ge)332 2035 y(gaps)46
b(by)f(arranging)g(the)g(entries)h(in)f(a)g(tr)m(ee.)57
b(They)46 b(ar)m(e)f(in)g(the)h(str)o(uctur)m(e)e Fp(sparse-vectors)p
Ft(.)368 2408 y Fl(\017)91 b Fp(\(make-sparse-vector\))i
Fl(!)e Fs(sparse-vector)368 2634 y Fl(\017)g Fp(\(sparse-vector-ref)i
Fs(sparse-vector)87 b(k)q Fp(\))k Fl(!)g Fs(value)368
2860 y Fl(\017)g Fp(\(sparse-vector-set!)i Fs(sparse-vector)88
b(k)i(value)p Fp(\))368 3086 y Fl(\017)h Fp(\(sparse-vector->list)i
Fs(sparse-vector)p Fp(\))88 b Fl(!)i Fs(list)332 3459
y Fp(Make-sparse-vector)p Ft(,)g Fp(sparse-vector-ref)p
Ft(,)g(and)79 b Fp(sparse-vector-set!)160 b Ft(ar)m(e)332
3685 y(analogous)67 b(to)g Fp(make-vector)p Ft(,)73 b
Fp(vector-ref)p Ft(,)g(and)67 b Fp(vector-set!)p Ft(,)73
b(except)67 b(that)g(the)g(in-)332 3911 y(dices)83 b(passed)h(to)g
Fp(sparse-vector-ref)h Ft(and)e Fp(sparse-vector-set!)171
b Ft(can)83 b(be)f(arbi-)332 4137 y(trarily)89 b(lar)m(ge.)189
b(For)90 b(indices)g(whose)f(elements)h(have)f(not)h(been)f(set)h(in)g
(a)f(sparse)h(vector)-13 b(,)332 4363 y Fp(sparse-vector-ref)47
b Ft(r)m(eturns)e Fp(#f)p Ft(.)614 4596 y Fp(Sparse-vector->list)k
Ft(is)f(for)f(debugging:)59 b(It)48 b(r)m(eturns)f(a)g(list)g(of)g(the)
h(consecutive)e(ele-)332 4822 y(ments)e(in)g(a)g(sparse)h(vector)f(fr)m
(om)f(0)h(to)h(the)g(highest)f(element)g(that)h(has)f(been)g(set.)56
b(Note)45 b(that)g(the)332 5048 y(list)h(will)f(also)g(include)g(all)g
(the)h Fp(#f)f Ft(elements)h(for)f(the)g(unset)h(elements.)332
5693 y Fm(5.7)238 b(Cells)332 6131 y Ft(These)57 b(hold)f(a)g(single)g
(value)f(and)h(ar)m(e)f(useful)g(when)g(a)h(simple)g(indir)m(ection)g
(is)g(r)m(equir)m(ed.)87 b(The)332 6357 y(system)46 b(uses)f(these)h
(to)g(hold)f(the)h(values)f(of)g(lexical)g(variables)f(that)i(may)f(be)
g Fp(set!)p Ft(.)368 6730 y Fl(\017)91 b Fp(\(cell?)103
b Fs(value)p Fp(\))90 b Fl(!)g Fs(boolean)368 6956 y
Fl(\017)h Fp(\(make-cell)h Fs(value)p Fp(\))e Fl(!)h
Fs(cell)368 7182 y Fl(\017)g Fp(\(cell-ref)h Fs(cell)p
Fp(\))e Fl(!)h Fs(value)368 7408 y Fl(\017)g Fp(\(cell-set!)h
Fs(cell)e(value)p Fp(\))332 8053 y Fm(5.8)238 b(Queues)332
8491 y Ft(These)46 b(ar)m(e)f(or)m(dinary)g(\002rst-in,)g(\002rst-out)h
(queues.)56 b(The)46 b(pr)m(ocedur)m(es)e(ar)m(e)h(in)h(str)o(uctur)m
(e)e Fp(queues)p Ft(.)368 8864 y Fl(\017)91 b Fp(\(make-queue\))h
Fl(!)f Fs(queue)368 9090 y Fl(\017)g Fp(\(queue?)103
b Fs(value)p Fp(\))90 b Fl(!)g Fs(boolean)368 9316 y
Fl(\017)h Fp(\(queue-empty?)103 b Fs(queue)p Fp(\))91
b Fl(!)g Fs(boolean)368 9541 y Fl(\017)g Fp(\(enqueue!)h
Fs(queue)f(value)p Fp(\))368 9767 y Fl(\017)g Fp(\(dequeue!)103
b Fs(queue)p Fp(\))91 b Fl(!)f Fs(value)332 10141 y Fp(Make-queue)52
b Ft(cr)m(eates)e(an)h(empty)g(queue,)h Fp(queue?)72
b Ft(is)51 b(a)g(pr)m(edicate)g(for)f(identifying)g(queues,)332
10366 y Fp(queue-empty?)101 b Ft(tells)61 b(you)f(if)f(a)h(queue)g(is)g
(empty)-20 b(,)64 b Fp(enqueue!)101 b Ft(and)60 b Fp(dequeue!)101
b Ft(add)60 b(and)332 10592 y(r)m(emove)45 b(values.)368
10966 y Fl(\017)91 b Fp(\(queue-length)h Fs(queue)p Fp(\))f
Fl(!)g Fs(integer)368 11191 y Fl(\017)g Fp(\(queue->list)h
Fs(queue)p Fp(\))f Fl(!)g Fs(values)368 11417 y Fl(\017)g
Fp(\(list->queue)h Fs(values)p Fp(\))e Fl(!)h Fs(queue)368
11643 y Fl(\017)g Fp(\(delete-from-queue!)104 b Fs(queue)91
b(value)p Fp(\))f Fl(!)g Fs(boolean)3661 12141 y Ft(32)p
eop end
%%Page: 33 41
TeXDict begin 33 40 bop 166 1146 a Fp(Queue-length)68
b Ft(r)m(eturns)e(the)h(number)e(of)h(values)g(in)h Fs(queue)p
Ft(.)120 b Fp(Queue->list)68 b Ft(r)m(eturns)e(the)166
1372 y(values)49 b(in)g Fs(queue)g Ft(as)g(a)g(list,)i(in)e(the)h(or)m
(der)f(in)g(which)f(the)h(values)g(wer)m(e)f(added.)69
b Fp(List->queue)166 1597 y Ft(r)m(eturns)81 b(a)g(queue)g(containing)g
Fs(values)o Ft(,)91 b(pr)m(eserving)81 b(their)h(or)m(der)-13
b(.)164 b Fp(Delete-from-queue)166 1823 y Ft(r)m(emoves)106
b(the)g(\002rst)h(instance)f(of)g Fs(value)g Ft(fr)m(om)f
Fp(queue)p Ft(,)122 b(using)106 b Fp(eq?)240 b Ft(for)106
b(comparisons.)166 2049 y Fp(Delete-from-queue)47 b Ft(r)m(eturns)e
Fp(#t)g Ft(if)g Fs(value)g Ft(is)g(found)g(and)g Fp(#f)h
Ft(if)f(it)g(is)h(not.)166 2663 y Fm(5.9)238 b(Arrays)166
3090 y Ft(These)37 b(pr)m(ovide)f(N-dimensional,)i(zer)m(o-based)d
(arrays)h(and)h(ar)m(e)f(in)g(the)g(str)o(uctur)m(e)f
Fp(arrays)p Ft(.)55 b(The)166 3316 y(array)45 b(interface)g(is)g
(derived)g(fr)m(om)g(one)g(invented)h(by)f(Alan)g(Bawden.)202
3669 y Fl(\017)91 b Fp(\(make-array)h Fs(value)e(dimension)2919
3696 y Fn(0)3088 3669 y Fs(.)27 b(.)g(.)g Fp(\))104 b
Fl(!)90 b Fs(array)202 3894 y Fl(\017)h Fp(\(array)h
Fs(dimensions)d(element)2616 3921 y Fn(0)2785 3894 y
Fs(.)27 b(.)g(.)g Fp(\))104 b Fl(!)91 b Fs(array)202
4120 y Fl(\017)g Fp(\(copy-array)h Fs(array)p Fp(\))e
Fl(!)h Fs(array)166 4473 y Fp(Make-array)55 b Ft(makes)f(a)h(new)e
(array)h(with)g(the)h(given)f(dimensions,)i(each)e(of)g(which)g(must)f
(be)166 4699 y(a)j(non-negative)g(integer)-13 b(.)88
b(Every)56 b(element)g(is)g(initially)g(set)g(to)h Fs(value)p
Ft(.)88 b Fp(Array)56 b Ft(Returns)g(a)g(new)166 4925
y(array)72 b(with)g(the)g(given)g(dimensions)g(and)g(elements.)138
b Fs(Dimensions)71 b Ft(must)h(be)g(a)g(list)g(of)h(non-)166
5150 y(negative)53 b(integers,)j(The)e(number)e(of)h(elements)h(should)
f(be)g(the)h(equal)f(to)h(the)f(pr)m(oduct)h(of)f(the)166
5376 y(dimensions.)j(The)46 b(elements)g(ar)m(e)f(stor)m(ed)g(in)h(r)m
(ow-major)d(or)m(der)-13 b(.)497 5765 y Fp(\(make-array)110
b('a)f(2)g(3\))h Fl(!)e(f)p Fp(Array)i(2)f(3)p Fl(g)497
6222 y Fp(\(array)g('\(2)h(3\))f('a)g('b)h('c)f('d)g('e)g('f\))933
6450 y Fl(!)g(f)p Fp(Array)g(2)h(3)p Fl(g)448 6836 y
Fp(Copy-array)59 b Ft(r)m(eturns)e(a)g(copy)h(of)f Fs(array)p
Ft(.)92 b(The)58 b(copy)g(is)f(identical)g(to)h(the)g
Fs(array)f Ft(but)f(does)166 7062 y(not)46 b(shar)m(e)f(storage)h(with)
f(it.)202 7415 y Fl(\017)91 b Fp(\(array?)103 b Fs(value)p
Fp(\))90 b Fl(!)g Fs(boolean)166 7767 y Ft(Returns)46
b Fp(#t)f Ft(if)g Fs(value)g Ft(is)g(an)g(array)-20 b(.)202
8120 y Fl(\017)91 b Fp(\(array-ref)h Fs(array)e(index)2456
8147 y Fn(0)2625 8120 y Fs(.)27 b(.)g(.)g Fp(\))104 b
Fl(!)91 b Fs(value)202 8346 y Fl(\017)g Fp(\(array-set!)h
Fs(array)e(value)g(index)3050 8373 y Fn(0)3219 8346 y
Fs(.)27 b(.)g(.)g Fp(\))202 8572 y Fl(\017)91 b Fp(\(array->vector)h
Fs(array)p Fp(\))e Fl(!)h Fs(vector)202 8798 y Fl(\017)g
Fp(\(array-dimensions)i Fs(array)p Fp(\))c Fl(!)i Fs(list)166
9150 y Fp(Array-ref)62 b Ft(r)m(eturns)e(the)i(speci\002ed)f(array)g
(element)f(and)h Fp(array-set!)104 b Ft(r)m(eplaces)61
b(the)g(ele-)166 9376 y(ment)45 b(with)g Fs(value)p Ft(.)497
9765 y Fp(\(let)109 b(\(\(a)h(\(array)f('\(2)h(3\))f('a)g('b)g('c)h('d)
f('e)g('f\)\)\))715 9993 y(\(let)g(\(\(x)h(\(array-ref)g(a)f(0)g
(1\)\)\))933 10222 y(\(array-set!)h(a)f('g)h(0)f(1\))933
10450 y(\(list)h(x)f(\(array-ref)h(a)f(0)g(1\)\)\)\))933
10679 y Fl(!)g Fp('\(b)g(g\))448 11065 y(Array->vector)60
b Ft(r)m(eturns)e(a)h(vector)g(containing)f(the)h(elements)f(of)h
Fs(array)e Ft(in)i(r)m(ow-major)166 11290 y(or)m(der)-13
b(.)56 b Fp(Array-dimensions)47 b Ft(r)m(eturns)e(the)g(dimensions)h
(of)f(the)g(array)g(as)h(a)f(list.)202 11643 y Fl(\017)91
b Fp(\(make-shared-array)i Fs(array)c(linear-map)g(dimension)4571
11670 y Fn(0)4740 11643 y Fs(.)27 b(.)g(.)g Fp(\))104
b Fl(!)91 b Fs(array)3495 12141 y Ft(33)p eop end
%%Page: 34 42
TeXDict begin 34 41 bop 332 1146 a Fp(Make-shared-array)72
b Ft(makes)e(a)h(new)f(array)g(that)h(shar)m(es)f(storage)h(with)f
Fs(array)g Ft(and)g(uses)332 1372 y Fs(linear-map)44
b Ft(to)j(map)g(indexes)f(to)h(elements.)59 b Fs(Linear-map)45
b Ft(must)h(accept)h(as)f(many)g(ar)m(guments)f(as)332
1597 y(the)60 b(number)f(of)h Fs(dimension)p Ft(s)f(given)h(and)g(must)
g(r)m(eturn)f(a)h(list)h(of)f(non-negative)f(integers)i(that)332
1823 y(ar)m(e)45 b(valid)g(indexes)g(into)h Fs(array)p
Ft(.)56 b(\241)663 2199 y Fp(\(array-ref)110 b(\(make-shared-array)h(a)
e(f)g(i0)g(i1)g(...\))1863 2425 y(j0)g(j1)g(...\))332
2800 y Ft(is)46 b(equivalent)e(to)663 3176 y Fp(\(apply)109
b(array-ref)h(a)g(\(f)f(j0)g(j1)g(...\)\))614 3551 y
Ft(As)51 b(an)e(example,)i(the)f(following)f(function)g(makes)g(the)h
(transpose)h(of)e(a)h(two-dimensional)332 3777 y(array:)663
4152 y Fp(\(define)110 b(\(transpose)g(array\))881 4378
y(\(let)f(\(\(dimensions)i(\(array-dimensions)f(array\)\)\))1099
4604 y(\(make-shared-array)h(array)3172 4830 y(\(lambda)f(\(x)f(y\))
3390 5056 y(\(list)h(y)f(x\)\))3172 5282 y(\(cadr)g(dimensions\))3172
5508 y(\(car)g(dimensions\)\)\)\))663 5959 y(\(array->vector)881
6185 y(\(transpose)1099 6411 y(\(array)h('\(2)f(3\))g('a)h('b)f('c)g
('d)h('e)f('f\)\)\))1317 6637 y Fl(!)g Fp('\(a)h(d)f(b)g(e)g(c)g(f\))
332 7235 y Fm(5.10)238 b(Records)332 7657 y Ft(New)81
b(types)g(can)f(be)h(constr)o(ucted)f(using)g(the)h Fp
(define-record-type)i Ft(macr)m(o)c(fr)m(om)h(the)332
7883 y Fp(define-record-types)47 b Ft(str)o(uctur)m(e)d(The)i(general)f
(syntax)h(is:)663 8258 y Fp(\(define-record-type)111
b Fs(tag)d(type-name)881 8484 y Fp(\()p Fs(constructor-name)f
(\002eld-tag)g Fp(...\))881 8710 y Fs(pr)m(edicate-name)881
8936 y Fp(\()p Fs(\002eld-tag)g(accessor-name)g Fp([)p
Fs(modi\002er-name)p Fp(]\))881 9162 y(...\))332 9537
y Ft(This)46 b(makes)f(the)h(following)e(de\002nitions:)368
9913 y Fl(\017)91 b Fs(type-name)5496 b Ft(type)368 10138
y Fl(\017)91 b Fp(\()p Fs(constructor-name)e(\002eld-init)f(.)27
b(.)g(.)g Fp(\))104 b Fl(!)91 b Fs(type-name)368 10364
y Fl(\017)g Fp(\()p Fs(pr)m(edicate-name)d(value)p Fp(\))i
Fl(!)h Fs(boolean)368 10590 y Fl(\017)g Fp(\()p Fs(accessor-name)e
(type-name)p Fp(\))h Fl(!)h Fs(value)368 10816 y Fl(\017)g
Fp(\()p Fs(modi\002er-name)f(type-name)f(value)p Fp(\))332
11191 y Fs(T)-17 b(ype-name)68 b Ft(is)h(the)g(r)m(ecor)m(d)g(type)g
(itself,)75 b(and)69 b(can)f(be)h(used)f(to)i(specify)f(a)f(print)h
(method)g(\(see)332 11417 y(below\).)59 b Fs(Constructor-name)44
b Ft(is)i(a)h(constr)o(uctor)e(that)i(accepts)f(values)g(for)g(the)h
(\002elds)f(whose)h(tags)332 11643 y(ar)m(e)65 b(speci\002ed.)118
b Fs(Pr)m(edicate-name)63 b Ft(is)i(a)h(pr)m(edicate)f(that)h(r)m
(eturns)f Fp(#t)h Ft(for)f(elements)g(of)h(the)f(type)3661
12141 y(34)p eop end
%%Page: 35 43
TeXDict begin 35 42 bop 166 1146 a Ft(and)61 b Fp(#f)g
Ft(for)f(everything)h(else.)103 b(The)61 b Fs(accessor-name)p
Ft(s)e(r)m(etrieve)i(the)g(values)f(of)h(\002elds,)k(and)c(the)166
1372 y Fs(modi\002er-name)p Ft('s)51 b(update)i(them.)77
b Fs(T)-20 b(ag)52 b Ft(is)h(used)f(in)h(printing)f(instances)g(of)h
(the)f(r)m(ecor)m(d)g(type)h(and)166 1597 y(the)41 b
Fs(\002eld-tag)p Ft(s)e(ar)m(e)i(used)g(in)g(the)g(inspector)g(and)g
(to)h(match)e(constr)o(uctor)h(ar)m(guments)f(with)g(\002elds.)202
1956 y Fl(\017)91 b Fp(\(define-record-discloser)i Fs(type)d(discloser)
p Fp(\))166 2315 y(Define-record-discloser)49 b Ft(determines)e(how)g
(r)m(ecor)m(ds)g(of)g(type)h Fs(type)e Ft(ar)m(e)h(printed.)63
b Fs(Dis-)166 2541 y(closer)53 b Ft(should)h(be)f(pr)m(ocedur)m(e)h
(which)f(takes)i(a)f(single)g(r)m(ecor)m(d)f(of)h(type)h
Fs(type)e Ft(and)h(r)m(eturns)g(a)g(list)166 2767 y(whose)k(car)g(is)g
(a)g(symbol.)94 b(The)58 b(r)m(ecor)m(d)g(will)f(be)h(printed)g(as)h
(the)f(value)f(r)m(eturned)h(by)f Fs(discloser)166 2993
y Ft(with)45 b(curly)g(braces)f(used)i(instead)f(of)h(the)f(usual)g
(par)m(enthesis.)448 3223 y(For)h(example)497 3619 y
Fp(\(define-record-type)111 b(pare)e(:pare)715 3849 y(\(kons)g(x)h(y\))
715 4079 y(pare?)715 4309 y(\(x)f(kar)h(set-kar!\))715
4539 y(\(y)f(kdr\)\))166 4931 y Ft(de\002nes)65 b Fp(kons)h
Ft(to)g(be)e(a)h(constr)o(uctor)-13 b(,)70 b Fp(kar)65
b Ft(and)g Fp(kdr)h Ft(to)f(be)g(accessors,)70 b Fp(set-kar!)117
b Ft(to)65 b(be)g(a)166 5157 y(modi\002er)-13 b(,)73
b(and)67 b Fp(pare?)124 b Ft(to)68 b(be)f(a)h(pr)m(edicate)f(for)h(a)f
(new)g(type)i(of)e(object.)123 b(The)68 b(type)h(itself)e(is)166
5383 y(named)45 b Fp(:pare)p Ft(.)57 b Fp(Pare)46 b Ft(is)f(a)h(tag)g
(used)f(in)g(printing)g(the)h(new)f(objects.)448 5613
y(By)54 b(default,)h(the)f(new)e(objects)h(print)h(as)f
Fp(#)p Fl(f)p Fp(Pare)p Fl(g)p Ft(.)81 b(The)53 b(print)h(method)f(can)
g(be)g(modi\002ed)166 5839 y(using)45 b Fp(define-record-discloser)p
Ft(:)497 6235 y Fp(\(define-record-discloser)111 b(:pare)715
6465 y(\(lambda)f(\(p\))f(`\(pare)h(,\(kar)f(p\))g(,\(kdr)h(p\)\)\)\))
166 6857 y Ft(will)45 b(cause)g(the)g(r)m(esult)g(of)h
Fp(\(kons)109 b(1)g(2\))46 b Ft(to)g(print)g(as)f Fp(#)p
Fl(f)p Fp(Pare)109 b(1)h(2)p Fl(g)p Ft(.)448 7088 y Fp
(Define-record-resumer)47 b Ft(\(section)e(7.9.3\))g(can)g(be)f(used)h
(to)h(contr)m(ol)e(how)h(r)m(ecor)m(ds)f(ar)m(e)166 7313
y(stor)m(ed)i(in)f(heap)h(images.)166 7849 y Fg(5.10.1)197
b(Low-level)50 b(access)h(to)f(records)166 8211 y Ft(Recor)m(ds)d(ar)m
(e)g(implemented)f(using)h(primitive)f(objects)h(exactly)g(analogous)f
(to)i(vectors.)61 b(Every)166 8437 y(r)m(ecor)m(d)e(has)h(a)f(r)m(ecor)
m(d)g(type)i(\(which)d(is)i(another)g(r)m(ecor)m(d\))e(in)i(the)g
(\002rst)g(slot.)100 b(Note)61 b(that)f(use)f(of)166
8663 y(these)h(pr)m(ocedur)m(es,)i(especially)e Fp(record-set!)p
Ft(,)k(br)m(eaks)59 b(the)g(r)m(ecor)m(d)g(abstraction)g(described)166
8889 y(above;)45 b(caution)g(is)h(advised.)448 9119 y(These)g(pr)m
(ocedur)m(es)f(ar)m(e)g(in)g(the)h(str)o(uctur)m(e)e
Fp(records)p Ft(.)202 9478 y Fl(\017)91 b Fp(\(make-record)h
Fs(n)f(value)p Fp(\))f Fl(!)h Fs(r)m(ecord)202 9703 y
Fl(\017)g Fp(\(record)h Fs(value)e(.)27 b(.)g(.)g Fp(\))104
b Fl(!)90 b Fs(r)m(ecord-vector)202 9929 y Fl(\017)h
Fp(\(record?)103 b Fs(value)p Fp(\))90 b Fl(!)g Fs(boolean)202
10155 y Fl(\017)h Fp(\(record-length)h Fs(r)m(ecord)p
Fp(\))e Fl(!)h Fs(integer)202 10381 y Fl(\017)g Fp(\(record-type)h
Fs(r)m(ecord)p Fp(\))e Fl(!)g Fs(value)202 10607 y Fl(\017)h
Fp(\(record-ref)h Fs(r)m(ecord)e(i)p Fp(\))g Fl(!)h Fs(value)202
10832 y Fl(\017)g Fp(\(record-set!)h Fs(r)m(ecord)e(i)g(value)p
Fp(\))166 11191 y Ft(These)77 b(the)f(same)f(as)h(the)g(standar)m(d)g
Fp(vector-)g Ft(pr)m(ocedur)m(es)g(except)g(that)g(they)g(operate)h(on)
166 11417 y(r)m(ecor)m(ds.)199 b(The)93 b(value)f(r)m(eturned)h(by)f
Fp(record-length)i Ft(includes)e(the)i(slot)f(holding)g(the)166
11643 y(r)m(ecor)m(d's)44 b(type.)58 b Fp(\(record-type)110
b Fs(x)p Fp(\))46 b Ft(is)f(equivalent)g(to)h Fp(\(record-ref)110
b Fs(x)f Fp(0\))p Ft(.)3495 12141 y(35)p eop end
%%Page: 36 44
TeXDict begin 36 43 bop 332 1146 a Fg(5.10.2)197 b(Record)49
b(types)332 1499 y Ft(Recor)m(d)136 b(types)g(ar)m(e)f(themselves)g(r)m
(ecor)m(ds)g(of)g(a)h(particular)e(type)i(\(the)g(\002rst)f(slot)h(of)
332 1725 y Fp(:record-type)70 b Ft(points)g(to)g(itself\).)128
b(A)69 b(r)m(ecor)m(d)g(type)h(contains)f(four)f(values:)104
b(the)70 b(name)e(of)332 1951 y(the)c(r)m(ecor)m(d)e(type,)69
b(a)63 b(list)h(of)f(the)g(names)g(its)h(\002elds,)k(and)63
b(pr)m(ocedur)m(es)g(for)g(disclosing)g(and)g(r)m(e-)332
2177 y(suming)58 b(r)m(ecor)m(ds)h(of)g(that)g(type.)99
b(Pr)m(ocedur)m(es)58 b(for)h(manipulating)f(them)h(ar)m(e)g(in)g(the)g
(str)o(uctur)m(e)332 2403 y Fp(record-types)p Ft(.)368
2704 y Fl(\017)91 b Fp(\(make-record-type)i Fs(name)e(\002eld-names)p
Fp(\))e Fl(!)i Fs(r)m(ecord-type)368 2930 y Fl(\017)g
Fp(\(record-type?)103 b Fs(value)p Fp(\))90 b Fl(!)h
Fs(boolean)368 3155 y Fl(\017)g Fp(\(record-type-name)i
Fs(r)m(ecord-type)p Fp(\))88 b Fl(!)j Fs(symbol)368 3381
y Fl(\017)g Fp(\(record-type-field-names)i Fs(r)m(ecord-type)p
Fp(\))c Fl(!)h Fs(symbols)368 3757 y Fl(\017)h Fp(\(record-constructor)
i Fs(r)m(ecord-type)88 b(\002eld-names)p Fp(\))h Fl(!)i
Fs(pr)m(ocedur)m(e)368 3983 y Fl(\017)g Fp(\(record-predicate)i
Fs(r)m(ecord-type)p Fp(\))88 b Fl(!)j Fs(pr)m(ocedur)m(e)368
4209 y Fl(\017)g Fp(\(record-accessor)i Fs(r)m(ecord-type)88
b(\002eld-name)p Fp(\))h Fl(!)i Fs(pr)m(ocedur)m(e)368
4435 y Fl(\017)g Fp(\(record-modifier)i Fs(r)m(ecord-type)88
b(\002eld-name)p Fp(\))h Fl(!)i Fs(pr)m(ocedur)m(e)332
4736 y Ft(These)238 b(pr)m(ocedur)m(es)g(constr)o(uct)f(the)h(usual)f
(r)m(ecor)m(d-manipulating)e(pr)m(ocedur)m(es.)332 4962
y Fp(Record-constructor)119 b Ft(r)m(eturns)d(a)i(constr)o(uctor)e
(that)i(is)f(passed)g(the)h(initial)f(values)332 5188
y(for)75 b(the)h(\002elds)g(speci\002ed)g(and)g(r)m(eturns)f(a)g(new)g
(r)m(ecor)m(d.)147 b Fp(Record-predicate)77 b Ft(r)m(eturns)e(a)332
5413 y(pr)m(edicate)64 b(that)h(r)m(eturn)f(tr)o(ue)g(when)g(passed)h
(a)f(r)m(ecor)m(d)g(of)g(type)h Fs(r)m(ecord-type)d Ft(and)i(false)h
(other)m(-)332 5639 y(wise.)79 b Fp(Record-accessor)55
b Ft(and)d Fp(record-modifier)j Ft(r)m(eturn)d(pr)m(ocedur)m(es)g(that)
i(r)m(efer)m(ence)332 5865 y(and)45 b(set)h(the)g(given)f(\002eld)h(in)
f(r)m(ecor)m(ds)g(of)g(the)g(appr)m(oriate)h(type.)368
6166 y Fl(\017)91 b Fp(\(define-record-discloser)i Fs(r)m(ecord-type)88
b(discloser)p Fp(\))368 6392 y Fl(\017)j Fp(\(define-record-resumer)i
Fs(r)m(ecord-type)88 b(r)m(esumer)p Fp(\))332 6693 y(Record-types)49
b Ft(is)g(the)f(initial)g(exporter)g(of)g Fp(define-record-discloser)j
Ft(\(r)m(e-exported)332 6919 y(by)61 b Fp(define-record-types)j
Ft(described)d(above\))f(and)i Fp(define-record-resumer)h
Ft(\(r)m(e-)332 7145 y(exported)46 b(by)f Fp(external-calls)i
Ft(\(section)e(7.9.3\)\).)614 7370 y(The)60 b(pr)m(ocedur)m(es)f
(described)g(in)g(this)g(section)h(can)e(be)h(used)h(to)g(de\002ne)f
(new)g(r)m(ecor)m(d-type-)332 7596 y(de\002ning)45 b(macr)m(os.)663
7930 y Fp(\(define-record-type)111 b(pare)e(:pare)881
8156 y(\(kons)h(x)f(y\))881 8382 y(pare?)881 8608 y(\(x)g(kar)h
(set-kar!\))881 8834 y(\(y)f(kdr\)\))332 9168 y Ft(is)46
b(\(sematically\))d(equivalent)i(to)663 9502 y Fp(\(define)110
b(:pare)f(\(make-record-type)i('pare)e('\(x)h(y\)\)\))663
9728 y(\(define)g(kons)f(\(record-constructor)i(:pare)e('\(x)h(y\)\)\))
663 9954 y(\(define)g(kar)f(\(record-accessor)h(:pare)g('x\)\))663
10180 y(\(define)g(set-kar!)f(\(record-modifier)i(:pare)e('x\)\))663
10406 y(\(define)h(kdr)f(\(record-accessor)h(:pare)g('y\)\))614
10740 y Ft(The)46 b(\223\(semantically\)\224)d(above)i(is)g(because)f
Fp(define-record-type)j Ft(adds)e(declarations,)332 10966
y(which)56 b(allows)i(the)f(type)h(checker)f(to)h(detect)g(some)f
(misuses)g(of)g(r)m(ecor)m(ds,)k(and)c(uses)g(mor)m(e)g(ef-)332
11191 y(\002cient)65 b(de\002nitions)g(for)g(the)g(constr)o(uctor)-13
b(,)69 b(accessors,)h(and)65 b(modi\002ers.)115 b(Ignoring)65
b(the)g(decla-)332 11417 y(rations,)k(which)63 b(will)g(have)g(to)h
(wait)g(for)f(another)h(edition)g(of)g(the)g(manual,)j(what)d(the)g
(above)332 11643 y(example)45 b(actually)g(expands)h(into)f(is:)3661
12141 y(36)p eop end
%%Page: 37 45
TeXDict begin 37 44 bop 497 1146 a Fp(\(define)109 b(:pare)h
(\(make-record-type)h('pare)e('\(x)h(y\)\)\))497 1374
y(\(define)f(\(kons)h(x)f(y\))g(\(record)h(:pare)g(x)f(y\)\))497
1602 y(\(define)g(\(kar)h(r\))f(\(checked-record-ref)i(r)e(:pare)h
(1\)\))497 1830 y(\(define)f(\(set-kar!)h(r)g(new\))715
2058 y(\(checked-record-set!)h(r)e(:pare)h(1)f(new\)\))497
2286 y(\(define)g(\(kdr)h(r\))f(\(checked-record-ref)i(r)e(:pare)h
(2\)\))166 2670 y(Checked-record-ref)48 b Ft(and)e Fp
(Checked-record-set!)60 b Ft(ar)m(e)45 b(low-level)g(pr)m(ocedur)m(es)h
(that)166 2896 y(check)f(the)h(type)g(of)f(the)h(r)m(ecor)m(d)e(and)i
(access)f(or)g(modify)g(it)h(using)f(a)g(single)h(VM)f(instr)o(uction.)
166 3507 y Fm(5.11)238 b(Finite)58 b(record)h(types)166
3933 y Ft(The)41 b(str)o(uctur)m(e)e Fp(finite-types)i
Ft(has)g(two)f(macr)m(os)g(for)g(de\002ning)g(`\002nite')g(r)m(ecor)m
(d)g(types.)56 b(These)166 4159 y(ar)m(e)49 b(r)m(ecor)m(d)g(types)h
(for)g(which)e(ther)m(e)h(ar)m(e)h(a)f(\002xed)h(number)e(of)h
(instances,)i(all)e(of)h(which)e(ar)m(e)h(cr)m(e-)166
4385 y(ated)c(at)g(the)g(same)f(time)h(as)f(the)h(r)m(ecor)m(d)f(type)h
(itself.)57 b(The)45 b(syntax)f(for)h(de\002ning)f(an)h(enumerated)166
4611 y(type)h(is:)497 4997 y Fp(\(define-enumerated-type)111
b Fs(tag)d(type-name)715 5225 y(pr)m(edicate-name)715
5453 y(vector-of-instances-name)715 5681 y(name-accessor)715
5909 y(index-accessor)715 6137 y Fp(\()p Fs(instance-name)f
Fp(...\)\))166 6521 y Ft(This)54 b(de\002nes)g(a)f(new)h(r)m(ecor)m(d)e
(type,)57 b(bound)c(to)i Fs(type-name)p Ft(,)f(with)g(as)f(many)g
(instances)h(as)f(ther)m(e)166 6747 y(ar)m(e)70 b Fs(instance-name)p
Ft('s.)129 b Fs(V)-17 b(ector-of-instances-name)66 b
Ft(is)71 b(bound)e(to)i(a)g(vector)f(containing)g(the)h(in-)166
6973 y(stances)46 b(of)f(the)h(type)h(in)e(the)h(same)f(or)m(der)h(as)g
(the)g Fs(instance-name)d Ft(list.)58 b Fs(T)-20 b(ag)45
b Ft(is)h(bound)f(to)h(a)g(macr)m(o)166 7199 y(that)41
b(when)g(given)g(an)f Fs(instance-name)f Ft(expands)j(into)f(an)g(expr)
m(ession)g(that)g(r)m(eturns)g(corr)m(espond-)166 7424
y(ing)56 b(instance.)88 b(The)56 b(name)g(lookup)g(is)g(done)g(at)h
(macr)m(o)e(expansion)h(time.)88 b Fs(Pr)m(edicate-name)53
b Ft(is)j(a)166 7650 y(pr)m(edicate)40 b(for)f(the)i(new)e(type.)56
b Fs(Name-accessor)38 b Ft(and)i Fs(index-accessor)d
Ft(ar)m(e)i(accessors)h(for)g(the)g(name)166 7876 y(and)45
b(index)g(\(in)g Fs(vector-of-instances)p Ft(\))40 b(of)46
b(instances)f(of)g(the)h(type.)497 8314 y Fp(\(define-enumerated-type)
111 b(color)e(:color)715 8542 y(color?)715 8771 y(colors)715
8999 y(color-name)715 9227 y(color-index)715 9455 y(\(black)h(white)f
(purple)h(maroon\)\))497 9911 y(\(color-name)g(\(vector-ref)g(colors)g
(0\)\))f Fl(!)g Fp(black)497 10139 y(\(color-name)h(\(color)f
(white\)\))983 b Fl(!)109 b Fp(white)497 10367 y(\(color-index)h
(\(color)g(purple\)\))764 b Fl(!)109 b Fp(2)448 10803
y Ft(Finite)62 b(types)h(ar)m(e)e(enumerations)g(that)h(allow)f(the)h
(user)g(to)g(add)g(additional)f(\002elds)h(in)g(the)166
11029 y(type.)c(The)45 b(syntax)h(for)f(de\002ning)g(a)h(\002nite)f
(type)h(is:)497 11415 y Fp(\(define-finite-type)111 b
Fs(tag)d(type-name)715 11643 y Fp(\()p Fs(\002eld-tag)f
Fp(...\))3495 12141 y Ft(37)p eop end
%%Page: 38 46
TeXDict begin 38 45 bop 881 1146 a Fs(pr)m(edicate-name)881
1374 y(vector-of-instances-name)881 1603 y(name-accessor)881
1831 y(index-accessor)881 2060 y Fp(\()p Fs(\002eld-tag)107
b(accessor-name)g Fp([)p Fs(modi\002er-name)p Fp(]\))881
2289 y(...)881 2517 y(\(\()p Fs(instance-name)g(\002eld-value)g
Fp(...\))990 2746 y(...\)\))332 3132 y Ft(The)51 b(additional)g
(\002elds)g(ar)m(e)g(speci\002ed)g(exactly)g(as)g(with)f
Fp(define-record-type)p Ft(.)75 b(The)51 b(\002eld)332
3358 y(ar)m(guments)59 b(to)i(the)g(constr)o(uctor)e(ar)m(e)h(listed)h
(after)e(the)i Fs(type-name)p Ft(;)67 b(these)60 b(do)h(not)f(include)g
(the)332 3584 y(name)51 b(and)g(index)g(\002elds.)74
b(The)52 b(form)e(ends)i(with)f(the)g(names)g(and)g(the)h(initial)e
(\002eld)i(values)e(for)332 3810 y(the)59 b(instances)f(of)g(the)h
(type.)97 b(The)59 b(instances)f(ar)m(e)g(constr)o(ucted)g(by)h
(applying)f(the)h(\(unnamed\))332 4035 y(constr)o(uctor)65
b(to)i(these)f(initial)g(\002eld)g(values.)118 b(The)67
b(name)e(must)g(be)h(\002rst)g(and)g(the)g(r)m(emaining)332
4261 y(values)45 b(must)g(match)g(the)g Fs(\002eld-tag)p
Ft(s)f(in)h(the)h(constr)o(uctor)13 b('s)44 b(ar)m(gument)h(list.)663
4703 y Fp(\(define-finite-type)111 b(color)e(:color)881
4931 y(\(red)g(green)h(blue\))881 5160 y(color?)881 5389
y(colors)881 5617 y(color-name)881 5846 y(color-index)881
6074 y(\(red)328 b(color-red\))881 6303 y(\(green)110
b(color-green\))881 6532 y(\(blue)219 b(color-blue\))881
6760 y(\(\(black)437 b(0)327 b(0)h(0\))990 6989 y(\(white)219
b(255)109 b(255)h(255\))990 7217 y(\(purple)g(160)218
b(32)110 b(240\))990 7446 y(\(maroon)g(176)218 b(48)h(96\)\)\))663
7903 y(\(color-name)110 b(\(color)g(black\)\))982 b Fl(!)109
b Fp(black)663 8132 y(\(color-name)h(\(vector-ref)g(colors)g(1\)\))f
Fl(!)g Fp(white)663 8360 y(\(color-index)h(\(color)g(purple\)\))764
b Fl(!)109 b Fp(2)663 8589 y(\(color-red)h(\(color)f(maroon\)\))983
b Fl(!)109 b Fp(176)332 9203 y Fm(5.12)238 b(Sets)59
b(over)g(\002nite)g(types)332 9631 y Ft(The)64 b(str)o(uctur)m(e)e
Fp(enum-sets)i Ft(has)g(a)f(macr)m(o)g(for)g(de\002ning)g(types)h(for)f
(sets)i(of)e(elements)g(of)h(\002-)332 9856 y(nite)47
b(types.)64 b(These)47 b(work)h(naturally)e(with)h(the)h(\002nite)f
(types)h(de\002ned)g(by)f(the)g Fp(finite-types)332 10082
y Ft(str)o(uctur)m(e,)e(but)g(ar)m(e)g(not)g(tied)h(to)g(them.)57
b(The)45 b(syntax)h(for)f(de\002ning)g(such)g(a)g(type)i(is:)663
10524 y Fp(\(define-enum-set-type)111 b Fs(id)d(type-name)g(pr)m
(edicate)f(constructor)990 10753 y(element-syntax)f(element-pr)m
(edicate)f(all-elements)h(element-index-r)m(ef)p Fp(\))332
11191 y Ft(This)62 b(de\002nes)f Fs(id)g Ft(to)g(be)g(syntax)g(for)g
(constr)o(ucting)g(sets,)66 b Fs(type-name)60 b Ft(to)h(be)g(a)g(value)
g(r)m(epr)m(esent-)332 11417 y(ing)52 b(the)g(type,)j
Fs(pr)m(edicate)49 b Ft(to)k(be)e(a)h(pr)m(edicate)g(for)g(those)g
(sets,)j(and)d Fs(constructor)d Ft(a)j(pr)m(ocedur)m(e)f(for)332
11643 y(constr)o(ucting)45 b(one)g(fr)m(om)g(a)g(list.)3661
12141 y(38)p eop end
%%Page: 39 47
TeXDict begin 39 46 bop 448 1146 a Fs(Element-syntax)64
b Ft(must)h(be)h(the)g(name)g(of)f(a)h(macr)m(o)f(for)h(constr)o
(ucting)f(set)h(elements)g(fr)m(om)166 1372 y(names)57
b(\(akin)g(to)g(the)h Fs(tag)f Ft(ar)m(gument)f(to)i
Fp(define-enumerated-type)p Ft(\).)94 b Fs(Element-pr)m(edicate)166
1597 y Ft(must)57 b(be)g(a)g(pr)m(edicate)h(for)f(the)g(element)h
(type,)j Fs(all-elements)55 b Ft(a)i(vector)g(of)h(all)f(values)g(of)g
(the)g(el-)166 1823 y(ement)e(type,)k(and)c Fs(element-index-r)m(ef)c
Ft(must)j(r)m(eturn)h(the)g(index)g(of)g(an)g(element)g(within)f(the)i
Fs(all-)166 2049 y(elements)44 b Ft(vector)-13 b(.)202
2388 y Fl(\017)91 b Fp(\(enum-set->list)h Fs(enum-set)p
Fp(\))e Fl(!)h Fs(list)202 2614 y Fl(\017)g Fp(\(enum-set-member?)104
b Fs(enum-set)89 b(enumerand)p Fp(\))i Fl(!)g Fs(boolean)202
2840 y Fl(\017)g Fp(\(enum-set=?)103 b Fs(enum-set)90
b(enum-set)p Fp(\))g Fl(!)g Fs(boolean)202 3066 y Fl(\017)h
Fp(\(enum-set-union)h Fs(enum-set)e(enum-set)p Fp(\))g
Fl(!)h Fs(enum-set)202 3291 y Fl(\017)g Fp(\(enum-set-intersection)i
Fs(enum-set)d(enum-set)p Fp(\))g Fl(!)181 b Fs(enum-set)202
3517 y Fl(\017)91 b Fp(\(enum-set-negation)i Fs(enum-set)p
Fp(\))d Fl(!)g Fs(enum-set)166 3856 y Fp(Enum-set->list)39
b Ft(converts)f(a)f(set)i(into)f(a)f(list)h(of)g(its)g(elements.)54
b Fp(Enum-set-member?)h Ft(tests)166 4082 y(for)g(membership.)86
b Fp(Enum-set=?)h Ft(tests)57 b(two)e(sets)i(of)e(equal)g(type)h(for)f
(equality)-20 b(.)87 b(\(If)55 b(its)g(ar)m(gu-)166 4308
y(ments)38 b(ar)m(e)g(not)h(of)g(the)f(same)h(type,)i
Fp(enum-set=?)55 b Ft(raises)38 b(an)g(exception.\))55
b Fp(Enum-set-union)166 4534 y Ft(computes)48 b(the)h(union)e(of)h(two)
h(sets)f(of)g(equal)g(type,)i Fp(enum-set-intersection)g
Ft(computes)166 4760 y(the)c(intersection,)g(and)f Fp
(enum-set-negation)i Ft(computes)e(the)h(complement)f(of)g(a)h(set.)448
4986 y(Her)m(e)g(is)f(an)g(example.)57 b(Given)45 b(an)g(enumerated)g
(type:)497 5407 y Fp(\(define-enumerated-type)111 b(color)e(:color)715
5633 y(color?)715 5859 y(colors)715 6085 y(color-name)715
6310 y(color-index)715 6536 y(\(red)g(blue)h(green\)\))448
6958 y Ft(we)45 b(can)g(de\002ne)h(sets)g(of)f(colors:)497
7380 y Fp(\(define-enum-set-type)111 b(color-set)f(:color-set)2897
7605 y(color-set?)2897 7831 y(make-color-set)715 8057
y(color)f(color?)h(colors)g(color-index\))497 8479 y(>)f
(\(enum-set->list)h(\(color-set)g(red)g(blue\)\))497
8704 y(\(#Color)f(red)h(#Color)f(blue\))497 8930 y(>)g
(\(enum-set->list)h(\(enum-set-negation)h(\(color-set)f(red)f
(blue\)\)\))497 9156 y(\(#Color)g(green\))497 9382 y(>)g
(\(enum-set-member?)i(\(color-set)f(red)f(blue\))g(\(color)h(blue\)\))
497 9608 y(#t)166 10204 y Fm(5.13)238 b(Hash)59 b(tables)166
10626 y Ft(These)46 b(ar)m(e)g(generic)f(hash)g(tables,)h(and)g(ar)m(e)
f(in)h(the)g(str)o(uctur)m(e)e Fp(tables)p Ft(.)59 b(Strictly)46
b(speaking)g(they)166 10852 y(ar)m(e)k(mor)m(e)h(maps)f(than)h(tables,)
h(as)f(every)g(table)f(has)h(a)g(value)f(for)g(every)h(possible)g(key)g
(\(for)f(that)166 11078 y(type)c(of)f(table\).)57 b(All)45
b(but)g(a)h(\002nite)f(number)f(of)h(those)h(values)f(ar)m(e)g
Fp(#f)p Ft(.)202 11417 y Fl(\017)91 b Fp(\(make-table\))h
Fl(!)f Fs(table)202 11643 y Fl(\017)g Fp(\(make-symbol-table\))i
Fl(!)e Fs(symbol-table)3495 12141 y Ft(39)p eop end
%%Page: 40 48
TeXDict begin 40 47 bop 368 1146 a Fl(\017)91 b Fp
(\(make-string-table\))i Fl(!)e Fs(string-table)368 1372
y Fl(\017)g Fp(\(make-integer-table\))i Fl(!)e Fs(integer-table)368
1597 y Fl(\017)g Fp(\(make-table-maker)i Fs(compar)m(e-pr)m(oc)88
b(hash-pr)m(oc)p Fp(\))h Fl(!)i Fs(pr)m(ocedur)m(e)368
1823 y Fl(\017)g Fp(\(make-table-immutable!)i Fs(table)p
Fp(\))332 2151 y Ft(The)72 b(\002rst)g(four)e(functions)h(listed)h
(make)f(various)g(kinds)g(of)h(tables.)134 b Fp(Make-table)73
b Ft(r)m(eturns)332 2377 y(a)62 b(table)f(whose)g(keys)h(may)g(be)f
(symbols,)66 b(integer)-13 b(,)65 b(characters,)h(booleans,)g(or)61
b(the)h(empty)g(list)332 2603 y(\(these)72 b(ar)m(e)g(also)h(the)f
(values)g(that)h(may)e(be)h(used)h(in)f Fp(case)g Ft(expr)m(essions\).)
137 b(As)73 b(with)f Fp(case)p Ft(,)332 2829 y(comparison)51
b(is)g(done)g(using)g Fp(eqv?)p Ft(.)74 b(The)52 b(comparison)f(pr)m
(ocedur)m(es)f(used)h(in)g(symbol,)i(string,)332 3055
y(and)45 b(integer)h(tables)f(ar)m(e)g Fp(eq?)p Ft(,)h
Fp(string=?)p Ft(,)h(and)e Fp(=)p Ft(.)614 3281 y Fp(Make-table-maker)
68 b Ft(takes)f(two)g(pr)m(ocedur)m(es)e(as)i(ar)m(guments)e(and)h(r)m
(eturns)g(a)g(nullary)332 3506 y(table-making)82 b(pr)m(ocedur)m(e.)168
b Fs(Compar)m(e-pr)m(oc)81 b Ft(should)i(be)g(a)f(two-ar)m(gument)g
(equality)h(pr)m(edi-)332 3732 y(cate.)104 b Fs(Hash-pr)m(oc)60
b Ft(should)h(be)g(a)g(one)g(ar)m(gument)f(pr)m(ocedur)m(e)h(that)g
(takes)h(a)f(key)h(and)f(r)m(eturns)f(a)332 3958 y(non-negative)51
b(integer)h(hash)f(value.)75 b(If)51 b Fp(\()p Fs(compar)m(e-pr)m(oc)
107 b(x)i(y)p Fp(\))51 b Ft(r)m(eturns)g(tr)o(ue,)i(then)f
Fp(\(=)109 b(\()p Fs(hash-)332 4184 y(pr)m(oc)f(x)p Fp(\))h(\()p
Fs(hash-pr)m(oc)e(y)p Fp(\)\))43 b Ft(must)f(also)h(r)m(eturn)e(tr)o
(ue.)56 b(For)42 b(example,)h Fp(make-integer-table)332
4410 y Ft(could)i(be)g(de\002ned)h(as)f Fp(\(make-table-maker)111
b(=)e(abs\))p Ft(.)614 4635 y Fp(Make-table-immutable!)59
b Ft(pr)m(ohibits)45 b(futur)m(e)f(modi\002cation)h(to)h(its)g(ar)m
(gument.)368 4964 y Fl(\017)91 b Fp(\(table?)103 b Fs(value)p
Fp(\))90 b Fl(!)g Fs(boolean)368 5190 y Fl(\017)h Fp(\(table-ref)h
Fs(table)e(key)p Fp(\))g Fl(!)h Fs(value)f(or)g Fp(#f)368
5415 y Fl(\017)h Fp(\(table-set!)h Fs(table)e(key)g(value)p
Fp(\))368 5641 y Fl(\017)h Fp(\(table-walk)h Fs(pr)m(ocedur)m(e)d
(table)p Fp(\))332 5969 y(Table?)d Ft(is)55 b(the)h(pr)m(edicate)f(for)
g(tables.)85 b Fp(Table-ref)56 b Ft(and)f Fp(table-set!)87
b Ft(access)55 b(and)g(mod-)332 6195 y(ify)60 b(the)g(value)f(of)h
Fs(key)g Ft(in)g Fs(table)p Ft(.)99 b Fp(Table-walk)61
b Ft(applies)g Fs(pr)m(ocedur)m(e)p Ft(,)h(which)d(must)h(accept)g(two)
332 6421 y(ar)m(guments,)45 b(to)h(every)f(associated)h(key)g(and)f
(non-)p Fp(#f)g Ft(value)g(in)g Fp(table)p Ft(.)368 6749
y Fl(\017)91 b Fp(\(default-hash-function)i Fs(value)p
Fp(\))d Fl(!)h Fs(integer)368 6975 y Fl(\017)g Fp(\(string-hash)h
Fs(string)p Fp(\))e Fl(!)h Fs(integer)332 7303 y Fp
(Default-hash-function)97 b Ft(is)e(the)f(hash)h(function)f(used)g(in)h
(the)g(tables)f(r)m(eturned)g(by)332 7529 y Fp(make-table)p
Ft(,)47 b(and)e Fp(string-hash)i Ft(it)e(the)h(one)g(used)f(by)g
Fp(make-string-table)p Ft(.)332 8124 y Fm(5.14)238 b(Port)59
b(extensions)332 8546 y Ft(These)46 b(pr)m(ocedur)m(es)f(ar)m(e)g(in)g
(str)o(uctur)m(e)f Fp(extended-ports)p Ft(.)368 8874
y Fl(\017)91 b Fp(\(make-string-input-port)i Fs(string)p
Fp(\))d Fl(!)h Fs(input-port)368 9100 y Fl(\017)g Fp
(\(make-string-output-port\))i Fl(!)e Fs(output-port)368
9326 y Fl(\017)g Fp(\(string-output-port-output)j Fs
(string-output-port)p Fp(\))86 b Fl(!)91 b Fs(string)332
9654 y Fp(Make-string-input-port)39 b Ft(r)m(eturns)c(an)i(input)f
(port)h(that)g(that)g(r)m(eads)f(characters)g(fr)m(om)f(the)332
9880 y(supplied)51 b(string.)73 b(An)51 b(end-of-\002le)f(object)g(is)h
(r)m(eturned)g(if)f(the)h(user)f(r)m(eads)h(past)g(the)g(end)g(of)g
(the)332 10105 y(string.)j Fp(Make-string-output-port)37
b Ft(r)m(eturns)e(an)g(output)h(port)g(that)g(saves)f(the)h(characters)
332 10331 y(written)41 b(to)g(it.)55 b(These)41 b(ar)m(e)g(then)f(r)m
(eturned)g(as)h(a)f(string)h(by)f Fp(string-output-port-output)p
Ft(.)663 10740 y Fp(\(read)109 b(\(make-string-input-port)j("\(a)d
(b\)"\)\))1099 10966 y Fl(!)g Fp('\(a)g(b\))663 11417
y(\(let)g(\(\(p)h(\(make-string-output-port\)\)\))881
11643 y(\(write)g('\(a)f(b\))g(p\))3661 12141 y Ft(40)p
eop end
%%Page: 41 49
TeXDict begin 41 48 bop 715 1146 a Fp(\(let)109 b(\(\(s)h
(\(string-output-port-output)h(p\)\)\))933 1377 y(\(display)f("c")f
(p\))933 1608 y(\(list)h(s)f(\(string-output-port-output)i(p\)\)\)\))
933 1839 y Fl(!)e Fp('\("\(a)h(b\)")f("\(a)g(b\)c"\))202
2286 y Fl(\017)91 b Fp(\(limit-output)h Fs(output-port)d(n)i(pr)m
(ocedur)m(e)p Fp(\))166 2650 y Fs(Pr)m(ocedur)m(e)c Ft(is)j(called)e
(on)i(an)f(output)g(port.)189 b(Output)89 b(written)g(to)h(that)f(port)
h(is)f(copied)g(to)166 2875 y Fs(output-port)59 b Ft(until)j
Fs(n)g Ft(characters)f(have)g(been)g(written,)67 b(at)62
b(which)f(point)h Fp(limit-output)h Ft(r)m(e-)166 3101
y(turns.)97 b(If)59 b Fs(pr)m(ocedur)m(e)e Ft(r)m(eturns)i(befor)m(e)f
(writing)g Fs(n)h Ft(characters,)j(then)d Fp(limit-output)i
Ft(also)e(r)m(e-)166 3327 y(turns)45 b(at)h(that)f(time,)h(r)m(egar)m
(dless)f(of)g(how)h(many)e(characters)h(have)g(been)g(written.)202
3691 y Fl(\017)91 b Fp(\(make-tracking-input-port)i Fs(input-port)p
Fp(\))c Fl(!)i Fs(input-port)202 3916 y Fl(\017)g Fp
(\(make-tracking-output-port)i Fs(output-port)p Fp(\))c
Fl(!)i Fs(output-port)202 4142 y Fl(\017)g Fp(\(current-row)h
Fs(port)p Fp(\))e Fl(!)h Fs(integer)e(or)h Fp(#f)202
4368 y Fl(\017)h Fp(\(current-column)h Fs(port)p Fp(\))e
Fl(!)h Fs(integer)e(or)i Fp(#f)202 4594 y Fl(\017)g Fp(\(fresh-line)h
Fs(output-port)p Fp(\))166 4957 y(Make-tracking-input-port)69
b Ft(and)e Fp(make-tracking-output-port)i Ft(r)m(eturn)d(ports)166
5183 y(that)h(keep)g(track)f(of)g(the)h(curr)m(ent)e(r)m(ow)h(and)g
(column)g(and)g(ar)m(e)g(otherwise)g(identical)g(to)h(their)166
5409 y(ar)m(guments.)53 b(Closing)38 b(a)g(tracking)g(port)h(does)f
(not)h(close)f(the)g(underlying)f(port.)55 b Fp(Current-row)166
5635 y Ft(and)49 b Fp(current-column)i Ft(r)m(eturn)e
Fs(port)o Ft('s)g(curr)m(ent)f(r)m(ead)h(or)g(write)h(location.)68
b(They)50 b(r)m(eturn)f Fp(#f)h Ft(if)166 5861 y Fs(port)61
b Ft(does)i(not)f(keep)h(track)f(of)g(its)g(location.)107
b Fp(Fresh-line)63 b Ft(writes)f(a)g(newline)f(character)g(to)166
6087 y Fs(output-port)43 b Ft(if)i Fp(\(current-row)110
b Fs(port)p Fp(\))44 b Ft(is)i(not)g(0.)497 6544 y Fp(\(define)109
b(p)h(\(open-output-port)g("/tmp/temp"\)\))497 6775 y(\(list)f
(\(current-row)h(p\))g(\(current-column)g(p\)\))933 7006
y Fl(!)f Fp('\(0)g(0\))497 7238 y(\(display)h("012")f(p\))497
7469 y(\(list)g(\(current-row)h(p\))g(\(current-column)g(p\)\))933
7700 y Fl(!)f Fp('\(0)g(3\))497 7931 y(\(fresh-line)h(p\))497
8162 y(\(list)f(\(current-row)h(p\))g(\(current-column)g(p\)\))933
8394 y Fl(!)f Fp('\(1)g(0\))497 8625 y(\(fresh-line)h(p\))497
8856 y(\(list)f(\(current-row)h(p\))g(\(current-column)g(p\)\))933
9087 y Fl(!)f Fp('\(1)g(0\))166 9718 y Fm(5.15)238 b(Fluid)59
b(bindings)166 10150 y Ft(These)43 b(pr)m(ocedur)m(es)e(implement)g
(dynamic)g(binding)g(and)h(ar)m(e)g(in)f(str)o(uctur)m(e)g
Fp(fluids)p Ft(.)56 b(A)42 b Fs(\003uid)g Ft(is)166 10376
y(a)49 b(cell)g(whose)g(value)g(can)f(be)h(bound)g(dynamically)-20
b(.)66 b(Each)49 b(\003uid)g(has)g(a)g(top-level)g(value)g(that)g(is)
166 10602 y(used)c(when)g(the)h(\003uid)e(is)i(unbound)e(in)h(the)h
(curr)m(ent)e(dynamic)h(envir)m(onment.)202 10966 y Fl(\017)91
b Fp(\(make-fluid)h Fs(value)p Fp(\))e Fl(!)h Fs(\003uid)202
11191 y Fl(\017)g Fp(\(fluid)h Fs(\003uid)p Fp(\))e Fl(!)h
Fs(value)202 11417 y Fl(\017)g Fp(\(let-fluid)h Fs(\003uid)f(value)e
(thunk)q Fp(\))i Fl(!)f Fs(value\(s\))202 11643 y Fl(\017)h
Fp(\(let-fluids)h Fs(\003uid)2017 11670 y Fn(0)2187 11643
y Fs(value)2582 11670 y Fn(0)2750 11643 y Fs(\003uid)3092
11670 y Fn(1)3262 11643 y Fs(value)3657 11670 y Fn(1)3826
11643 y Fs(.)27 b(.)g(.)g(thunk)q Fp(\))92 b Fl(!)f Fs(value\(s\))3495
12141 y Ft(41)p eop end
%%Page: 42 50
TeXDict begin 42 49 bop 332 1146 a Fp(Make-fluid)60 b
Ft(r)m(eturns)e(a)g(new)g(\003uid)g(with)h Fs(value)e
Ft(as)i(its)g(initial)f(top-level)h(value.)96 b Fp(Fluid)59
b Ft(r)m(e-)332 1372 y(turns)46 b Fp(fluid)p Ft('s)h(curr)m(ent)f
(value.)59 b Fp(Let-fluid)48 b Ft(calls)e Fp(thunk)p
Ft(,)i(with)e Fs(\003uid)h Ft(bound)f(to)h Fs(value)f
Ft(until)332 1597 y Fp(thunk)62 b Ft(r)m(eturns.)106
b(Using)62 b(a)g(continuation)f(to)i(thr)m(ow)e(out)h(of)g(the)g(call)f
(to)i Fp(thunk)f Ft(causes)f Fs(\003uid)332 1823 y Ft(to)k(r)m(evert)e
(to)h(its)h(original)e(value,)68 b(while)c(thr)m(owing)f(back)g(in)h
(causes)f Fs(\003uid)h Ft(to)g(be)g(r)m(ebound)f(to)332
2049 y Fs(value)p Ft(.)55 b Fp(Let-fluid)43 b Ft(r)m(eturns)e(the)i
(value\(s\))e(r)m(eturned)g(by)h Fs(thunk)p Ft(.)55 b
Fp(Let-fluids)43 b Ft(is)g(identical)f(to)332 2275 y
Fp(let-fluid)k Ft(except)g(that)g(it)f(binds)g(an)h(arbitrary)e(number)
g(of)h(\003uids)g(to)h(new)f(values.)663 2667 y Fp(\(let*)109
b(\(\(f)h(\(make-fluid)g('a\)\))1426 2892 y(\(v0)g(\(fluid)f(f\)\))1426
3118 y(\(v1)h(\(let-fluid)g(f)f('b)2081 3344 y(\(lambda)h(\(\))2299
3570 y(\(fluid)g(f\)\)\)\))1426 3796 y(\(v2)g(\(fluid)f(f\)\)\))881
4021 y(\(list)h(v0)f(v1)g(v2\)\))881 4247 y Fl(!)g Fp('\(a)g(b)g(a\))
663 4639 y(\(let)g(\(\(f)h(\(make-fluid)g('a\)\))1317
4865 y(\(path)g('\(\)\))1317 5091 y(\(c)g(#f\)\))881
5316 y(\(let)f(\(\(add)h(\(lambda)g(\(\))2299 5542 y(\(set!)g(path)f
(\(cons)h(\(fluid)f(f\))h(path\)\)\)\)\))1099 5768 y(\(add\))1099
5994 y(\(let-fluid)g(f)f('b)1317 6220 y(\(lambda)h(\(\))1536
6446 y(\(call-with-current-continuation)1754 6671 y(\(lambda)f(\(c0\))
1972 6897 y(\(set!)g(c)h(c0\)\)\))1536 7123 y(\(add\)\)\))1099
7349 y(\(add\))1099 7575 y(\(if)g(\(<)f(\(length)h(path\))f(5\))1536
7800 y(\(c\))1536 8026 y(\(reverse)g(path\)\)\)\))881
8252 y Fl(!)g Fp('\(a)g(b)g(a)h(b)f(a\))332 8844 y Fm(5.16)238
b(Shell)58 b(commands)332 9266 y Ft(Str)o(uctur)m(e)45
b Fp(c-system-function)i Ft(pr)m(ovides)e(access)g(to)h(the)g(C)f
Fp(system\(\))h Ft(function.)368 9580 y Fl(\017)91 b
Fp(\(have-system?\))103 b Fl(!)91 b Fs(boolean)368 9806
y Fl(\017)g Fp(\(system)h Fs(string)p Fp(\))d Fl(!)i
Fs(integer)332 10120 y Fp(Have-system?)135 b Ft(r)m(eturns)70
b(tr)o(ue)h(if)f(the)i(underlying)e(C)h(implementation)g(has)g(a)g
(command)332 10346 y(pr)m(ocessor)-13 b(.)109 b Fp(\(System)h
Fs(string)p Fp(\))61 b Ft(passes)j Fs(string)d Ft(to)j(the)f(C)g
Fp(system\(\))g Ft(function)f(and)h(r)m(eturns)332 10572
y(the)46 b(r)m(esult.)663 10963 y Fp(\(begin)881 11189
y(\(system)110 b("echo)f(foo)h(>)f(test-file"\))881 11415
y(\(call-with-input-file)i("test-file")f(read\)\))663
11641 y Fl(!)f Fp('foo)3661 12141 y Ft(42)p eop end
%%Page: 43 51
TeXDict begin 43 50 bop 166 1146 a Fm(5.17)238 b(Sockets)166
1568 y Ft(Str)o(uctur)m(e)56 b Fp(sockets)i Ft(pr)m(ovides)f(access)g
(to)h(TCP/IP)f(sockets)h(for)f(interpr)m(ocess)g(and)g(network)166
1793 y(communication.)202 2127 y Fl(\017)91 b Fp(\(open-socket\))h
Fl(!)f Fs(socket)202 2353 y Fl(\017)g Fp(\(open-socket)h
Fs(port-number)p Fp(\))e Fl(!)h Fs(socket)202 2578 y
Fl(\017)g Fp(\(socket-port-number)i Fs(socket)p Fp(\))c
Fl(!)i Fs(integer)202 2804 y Fl(\017)g Fp(\(close-socket)h
Fs(socket)p Fp(\))202 3030 y Fl(\017)f Fp(\(socket-accept)h
Fs(socket)p Fp(\))e Fl(!)h Fs(input-port)d(output-port)202
3256 y Fl(\017)j Fp(\(get-host-name\))h Fl(!)f Fs(string)166
3589 y Fp(Open-socket)36 b Ft(cr)m(eates)f(a)h(new)f(socket.)54
b(If)35 b(no)g Fs(port-number)f Ft(is)i(supplied)f(the)h(system)f
(picks)h(one)166 3815 y(at)49 b(random.)65 b Fp(Socket-port-number)51
b Ft(r)m(eturns)c(a)i(socket's)g(port)g(number)-13 b(.)64
b Fp(Close-socket)166 4041 y Ft(closes)56 b(a)g(socket,)j(pr)m
(eventing)c(any)h(further)f(connections.)87 b Fp(Socket-accept)57
b Ft(accepts)f(a)g(sin-)166 4267 y(gle)47 b(connection)h(on)f
Fs(socket)p Ft(,)g(r)m(eturning)f(an)h(input)g(port)h(and)f(an)h
(output)f(port)h(for)f(communicat-)166 4493 y(ing)k(with)f(the)h
(client.)72 b(If)50 b(no)h(client)f(is)h(waiting)f Fp(socket-accept)i
Ft(blocks)e(until)g(one)h(appears.)166 4718 y Fp(Get-host-name)c
Ft(r)m(eturns)d(the)i(network)f(name)g(of)h(the)f(machine.)202
5052 y Fl(\017)91 b Fp(\(socket-client)h Fs(host-name)e(port-number)p
Fp(\))f Fl(!)i Fs(input-port)e(output-port)166 5385 y
Fp(Socket-client)63 b Ft(connects)e(to)h(the)f(server)g(at)h
Fs(port-number)e Ft(on)h(the)h(machine)e(named)h Fs(host-)166
5611 y(name)p Ft(.)c Fp(Socket-client)46 b Ft(blocks)g(until)f(the)g
(server)g(accepts)h(the)f(connection.)448 5837 y(The)72
b(following)e(simple)h(example)g(shows)g(a)g(server)g(and)f(client)h
(for)g(a)g(centralized)g(UID)166 6063 y(service.)497
6429 y Fp(\(define)109 b(\(id-server\))715 6655 y(\(let)g(\(\(socket)h
(\(open-socket\)\)\))933 6881 y(\(display)g("Waiting)g(on)f(port)g("\))
933 7107 y(\(display)h(\(socket-port-number)h(socket\)\))933
7332 y(\(newline\))933 7558 y(\(let)f(loop)f(\(\(next-id)h(0\)\))1151
7784 y(\(call-with-values)1369 8010 y(\(lambda)g(\(\))1588
8236 y(\(socket-accept)g(socket\)\))1369 8462 y(\(lambda)g(\(in)g
(out\))1588 8687 y(\(display)f(next-id)h(out\))1588 8913
y(\(close-input-port)g(in\))1588 9139 y(\(close-output-port)g(out\))
1588 9365 y(\(loop)f(\(+)g(next-id)h(1\)\)\)\)\)\)\))497
9816 y(\(define)f(\(get-id)h(machine)g(port-number\))715
10042 y(\(call-with-values)933 10268 y(\(lambda)g(\(\))1151
10494 y(\(socket-client)h(machine)e(port-number\)\))933
10720 y(\(lambda)h(\(in)f(out\))1151 10946 y(\(let)h(\(\(id)f(\(read)h
(in\)\)\))1369 11171 y(\(close-input-port)h(in\))1369
11397 y(\(close-output-port)g(out\))1369 11623 y(id\)\)\)\))3495
12141 y Ft(43)p eop end
%%Page: 44 52
TeXDict begin 44 51 bop 332 1146 a Fm(5.18)238 b(Macros)59
b(for)h(writing)f(loops)332 1568 y Fp(Iterate)40 b Ft(and)g
Fp(reduce)g Ft(ar)m(e)f(extensions)h(of)f(named-)p Fp(let)g
Ft(for)g(writing)g(loops)h(that)g(walk)f(down)332 1793
y(one)64 b(or)g(mor)m(e)g(sequences,)k(such)c(as)g(the)g(elements)g(of)
f(a)h(list)h(or)f(vector)-13 b(,)68 b(the)c(characters)f(r)m(ead)332
2019 y(fr)m(om)47 b(a)h(port,)h(or)f(an)g(arithmetic)f(series.)65
b(Additional)48 b(sequences)g(can)f(be)h(de\002ned)g(by)f(the)h(user)
-13 b(.)332 2245 y Fp(Iterate)46 b Ft(and)f Fp(reduce)h
Ft(ar)m(e)f(in)h(str)o(uctur)m(e)e Fp(reduce)p Ft(.)332
2738 y Fg(5.18.1)197 b Ff(Iterate)332 3092 y Ft(The)46
b(syntax)f(of)h Fp(iterate)g Ft(is:)881 3388 y Fp(\(iterate)110
b Fs(loop-name)1863 3614 y Fp(\(\()p Fs(sequence-type)d
(element-variable)e(sequence-data)i Fp(...\))1972 3840
y(...\))1863 4066 y(\(\()p Fs(state-variable)e(initial-value)p
Fp(\))1972 4291 y(...\))1099 4517 y Fs(body-expr)m(ession)1099
4743 y Fp([)p Fs(\002nal-expr)m(ession)p Fp(]\))614 5039
y(Iterate)52 b Ft(steps)f(the)g Fs(element-variable)p
Ft(s)c(in)j(parallel)g(thr)m(ough)g(the)h(sequences,)h(while)e(each)332
5265 y Fs(state-variable)62 b Ft(has)k(the)g(corr)m(esponding)f
Fs(initial-value)d Ft(for)k(the)g(\002rst)g(iteration)g(and)g(have)f
(later)332 5491 y(values)i(supplied)h(by)f Fs(body-expr)m(ession)p
Ft(.)121 b(If)67 b(any)g(sequence)g(has)h(r)m(eached)f(its)h(limit)f
(the)h(value)332 5717 y(of)e(the)f Fp(iterate)i Ft(expr)m(ession)e(is)h
(the)g(value)e(of)i Fs(\002nal-expr)m(ession)p Ft(,)h(if)e(pr)m(esent,)
72 b(or)65 b(the)h(curr)m(ent)332 5942 y(values)56 b(of)g(the)h
Fs(state-variable)p Ft(s,)f(r)m(eturned)g(as)h(multiple)f(values.)89
b(If)57 b(no)f(sequence)g(has)h(r)m(eached)332 6168 y(its)41
b(limit,)h Fs(body-expr)m(ession)37 b Ft(is)k(evaluated)g(and)f(either)
h(calls)f Fs(loop-name)g Ft(with)g(new)g(values)g(for)h(the)332
6394 y Fs(state-variable)p Ft(s,)h(or)k(r)m(eturns)e(some)i(other)f
(value\(s\).)614 6620 y(The)i Fs(loop-name)e Ft(and)h(the)g
Fs(state-variable)p Ft(s)d(and)j Fs(initial-value)p Ft(s)c(behave)k
(exactly)g(as)g(in)g(named-)332 6846 y Fp(let)p Ft(.)57
b(The)46 b(named-)p Fp(let)f Ft(expr)m(ession)881 7142
y Fp(\(let)109 b(loop-name)h(\(\(state-variable)h(initial-value\))f
(...\))1099 7368 y(body)g(...\))332 7664 y Ft(is)50 b(equivalent)e(to)i
(an)g Fp(iterate)g Ft(expr)m(ession)f(with)g(no)h(sequences)f(\(and)g
(with)g(an)g(explicit)h Fp(let)332 7889 y Ft(wrapped)c(ar)m(ound)e(the)
i(body)f(expr)m(essions)h(to)g(take)g(car)m(e)e(of)i(any)f(internal)g
Fp(define)p Ft(s\):)881 8186 y Fp(\(iterate)110 b(loop-name)1863
8411 y(\(\))1863 8637 y(\(\(state-variable)g(initial-value\))h(...\))
1099 8863 y(\(let)f(\(\))f(body)g(...\)\))614 9159 y
Ft(The)41 b Fs(sequence-type)p Ft(s)c(ar)m(e)j(keywor)m(ds)f(\(they)h
(ar)m(e)f(actually)h(macr)m(os)e(of)i(a)g(particular)f(form;)i(it)f(is)
332 9385 y(easy)53 b(to)g(add)g(additional)g(types)h(of)e(sequences\).)
78 b(Examples)53 b(ar)m(e)f Fp(list*)h Ft(which)f(walks)g(down)332
9611 y(the)36 b(elements)f(of)h(a)f(list)h(and)f Fp(vector*)h
Ft(which)f(does)h(the)g(same)f(for)g(vectors.)54 b(For)35
b(each)g(iteration,)332 9836 y(each)56 b Fs(element-variable)c
Ft(is)k(bound)f(to)h(the)g(next)g(element)g(of)g(the)g(sequence.)87
b(The)56 b Fs(sequence-data)332 10062 y Ft(gives)45 b(the)h(actual)f
(list)h(or)f(vector)g(or)h(whatever)-13 b(.)614 10288
y(If)48 b(ther)m(e)f(is)h(a)g Fs(\002nal-expr)m(ession)p
Ft(,)d(it)j(is)f(evaluated)h(when)f(the)h(end)f(of)h(one)g(or)f(mor)m
(e)h(sequences)332 10514 y(is)f(r)m(eached.)59 b(If)47
b(the)g Fs(body-expr)m(ession)c Ft(does)k(not)g(call)f
Fs(loop-name)f Ft(the)i Fs(\002nal-expr)m(ession)c Ft(is)k(not)g(eval-)
332 10740 y(uated.)55 b(The)40 b Fs(state-variable)p
Ft(s)35 b(ar)m(e)k(visible)g(in)g Fs(\002nal-expr)m(ession)d
Ft(but)j(the)h Fs(sequence-variable)p Ft(s)c(ar)m(e)j(not.)614
10966 y(The)i Fs(body-expr)m(ession)c Ft(and)j(the)g
Fs(\002nal-expr)m(ession)c Ft(ar)m(e)k(in)g(tail-position)g(within)g
(the)g Fp(iterate)p Ft(.)332 11191 y(Unlike)65 b(named-)p
Fp(let)p Ft(,)k(the)c(behavior)f(of)h(a)f(non-tail-r)m(ecursive)f(call)
h(to)h Fs(loop-name)e Ft(is)i(unspec-)332 11417 y(i\002ed)i(\(because)f
(iterating)h(down)g(a)h(sequence)e(may)h(involve)f(side)i(ef)m(fects,)k
(such)66 b(as)i(r)m(eading)332 11643 y(characters)45
b(fr)m(om)f(a)h(port\).)3661 12141 y(44)p eop end
%%Page: 45 53
TeXDict begin 45 52 bop 166 1146 a Fg(5.18.2)197 b Ff(Reduce)166
1507 y Ft(If)46 b(an)g Fp(iterate)g Ft(expr)m(ession)g(is)g(not)h
(meant)e(to)i(terminate)e(befor)m(e)g(a)h(sequence)g(has)g(r)m(eached)f
(its)166 1733 y(end,)58 b Fs(body-expr)m(ession)53 b
Ft(will)h(always)h(end)h(with)f(a)g(tail)g(call)g(to)h
Fs(loop-name)p Ft(.)85 b Fp(Reduce)56 b Ft(is)g(a)f(macr)m(o)166
1959 y(that)61 b(makes)f(this)h(common)e(case)i(explicit.)102
b(The)61 b(syntax)f(of)g Fp(reduce)i Ft(is)e(the)h(same)f(as)g(that)h
(of)166 2184 y Fp(iterate)p Ft(,)67 b(except)c(that)f(ther)m(e)g(is)g
(no)h Fs(loop-name)p Ft(.)105 b(The)63 b Fs(body-expr)m(ession)c
Ft(r)m(eturns)i(new)h(values)166 2410 y(of)56 b(the)h
Fs(state-variable)p Ft(s)52 b(instead)57 b(of)f(passing)h(them)f(to)h
Fs(loop-name)p Ft(.)88 b(Thus)56 b Fs(body-expr)m(ession)e
Ft(must)166 2636 y(r)m(eturn)42 b(as)i(many)e(values)h(as)g(ther)m(e)g
(ar)m(e)g(state)h(variables.)55 b(By)43 b(special)g(dispensation,)i(if)
d(ther)m(e)h(ar)m(e)166 2862 y(no)49 b(state)h(variables)e(then)h
Fs(body-expr)m(ession)c Ft(may)k(r)m(eturn)f(any)h(number)e(of)i
(values,)h(all)e(of)h(which)166 3088 y(ar)m(e)c(ignor)m(ed.)448
3317 y(The)h(syntax)g(of)f Fp(reduce)h Ft(is:)715 3711
y Fp(\(reduce)110 b(\(\()p Fs(sequence-type)d(element-variable)e
(sequence-data)i Fp(...\))1806 3940 y(...\))1697 4170
y(\(\()p Fs(state-variable)e(initial-value)p Fp(\))1806
4399 y(...\))933 4629 y Fs(body-expr)m(ession)933 4858
y Fp([)p Fs(\002nal-expr)m(ession)p Fp(]\))448 5248 y
Ft(The)67 b(value\(s\))e(r)m(eturned)g(by)h(an)g(instance)g(of)g
Fp(reduce)h Ft(is)f(the)h(value\(s\))d(r)m(eturned)i(by)g(the)166
5474 y Fs(\002nal-expr)m(ession)p Ft(,)54 b(if)h(pr)m(esent,)j(or)d
(the)h(curr)m(ent)e(value\(s\))f(of)i(the)h(state)f(variables)f(when)h
(the)g(end)166 5700 y(of)45 b(one)h(or)f(mor)m(e)g(sequences)g(is)h(r)m
(eached.)448 5930 y(A)60 b Fp(reduce)h Ft(expr)m(ession)e(can)h(be)f(r)
m(ewritten)g(as)h(an)f(equivalent)g Fp(iterate)i Ft(expr)m(ession)e(by)
166 6155 y(adding)45 b(a)h Fs(loop-var)d Ft(and)i(a)h(wrapper)f(for)g
(the)h Fs(body-expr)m(ession)c Ft(that)k(calls)f(the)g
Fs(loop-var)p Ft(.)497 6549 y Fp(\(iterate)110 b(loop)1479
6779 y(\(\()p Fs(sequence-type)d(element-variable)e(sequence-data)i
Fp(...\))1588 7008 y(...\))1479 7238 y(\(\()p Fs(state-variable)e
(initial-value)p Fp(\))1588 7467 y(...\))715 7697 y(\(call-with-values)
111 b(\(lambda)e(\(\))2897 7926 y Fs(body-expr)m(ession)p
Fp(\))2679 8156 y(loop\))715 8385 y([)p Fs(\002nal-expr)m(ession)p
Fp(]\))166 8917 y Fg(5.18.3)197 b(Sequence)49 b(types)166
9279 y Ft(The)d(pr)m(ede\002ned)f(sequence)g(types)h(ar)m(e:)202
9669 y Fl(\017)91 b Fp(\(list*)h Fs(elt-var)c(list)p
Fp(\))4430 b Ft(syntax)202 9894 y Fl(\017)91 b Fp(\(vector*)h
Fs(elt-var)c(vector)p Fp(\))3997 b Ft(syntax)202 10120
y Fl(\017)91 b Fp(\(string*)h Fs(elt-var)c(string)p Fp(\))4000
b Ft(syntax)202 10346 y Fl(\017)91 b Fp(\(count*)h Fs(elt-var)c(start)i
Fp([)p Fs(end)g Fp([)p Fs(step)p Fp(]]\))3037 b Ft(syntax)202
10572 y Fl(\017)91 b Fp(\(input*)h Fs(elt-var)c(input-port)h(r)m
(ead-pr)m(ocedur)m(e)p Fp(\))2608 b Ft(syntax)202 10798
y Fl(\017)91 b Fp(\(stream*)h Fs(elt-var)c(pr)m(ocedur)m(e)h
(initial-data)p Fp(\))2819 b Ft(syntax)448 11188 y(For)55
b(lists,)j(vectors,)f(and)e(strings)g(the)g(element)f(variable)g(is)g
(bound)g(to)i(the)f(successive)e(ele-)166 11414 y(ments)45
b(of)h(the)f(list)h(or)f(vector)-13 b(,)46 b(or)f(the)h(characters)f
(in)g(the)g(string.)448 11643 y(For)h Fp(count*)g Ft(the)g(element)f
(variable)f(is)i(bound)e(to)i(the)g(elements)f(of)h(the)f(sequence)3495
12141 y(45)p eop end
%%Page: 46 54
TeXDict begin 46 53 bop 772 1146 a Fs(start)p Fp(,)107
b Fs(start)h Fp(+)h Fs(step)p Fp(,)f Fs(start)f Fp(+)i(2)p
Fs(step)p Fp(,)g(...,)g Fs(end)332 1569 y Ft(inclusive)59
b(of)h Fs(start)e Ft(and)i(exclusive)f(of)h Fs(end)p
Ft(.)100 b(The)60 b(default)g Fs(step)f Ft(is)h(1.)100
b(The)61 b(sequence)e(does)i(not)332 1795 y(terminate)35
b(if)f(no)h Fs(end)g Ft(is)g(given)f(or)i(if)e(ther)m(e)h(is)g(no)g
Fh(N)70 b(>)51 b Fi(0)35 b Ft(such)f(that)h Fs(end)g
Ft(=)g Fs(start)f Ft(+)h(N)p Fs(step)f Ft(\()p Fp(=)g
Ft(is)h(used)332 2021 y(to)52 b(test)f(for)g(termination\).)72
b(For)51 b(example,)i Fp(\(count*)110 b(i)f(0)g(-1\))51
b Ft(doesn't)g(terminate)g(because)332 2246 y(it)68 b(begins)f(past)i
(the)e Fs(end)h Ft(value)f(and)h Fp(\(count*)109 b(i)g(0)h(1)f(2\))68
b Ft(doesn't)g(terminate)f(because)g(it)332 2472 y(skips)46
b(over)f(the)h Fs(end)f Ft(value.)614 2710 y(For)38 b
Fp(input*)g Ft(the)g(elements)g(ar)m(e)f(the)h(r)m(esults)f(of)h
(successive)e(applications)i(of)g Fs(r)m(ead-pr)m(ocedur)m(e)332
2936 y Ft(to)46 b Fs(input-port)p Ft(.)55 b(The)45 b(sequence)g(ends)h
(when)f Fs(r)m(ead-pr)m(ocedur)m(e)c Ft(r)m(eturns)k(an)g
(end-of-\002le)g(object.)614 3174 y(For)40 b(a)g(str)m(eam,)h(the)f
Fs(pr)m(ocedur)m(e)e Ft(takes)i(the)g(curr)m(ent)f(data)h(value)f(as)h
(an)f(ar)m(gument)g(and)h(r)m(eturns)332 3399 y(two)i(values,)h(the)f
(next)g(value)g(of)f(the)i(sequence)e(and)h(a)g(new)g(data)g(value.)55
b(If)42 b(the)g(new)g(data)g(is)g Fp(#f)332 3625 y Ft(then)k(the)f(pr)m
(evious)g(element)g(was)h(the)f(last)h(one.)57 b(For)45
b(example,)881 4060 y Fp(\(list*)110 b(elt)f(my-list\))332
4484 y Ft(is)46 b(the)f(same)g(as)881 4919 y Fp(\(stream*)110
b(elt)f(list->stream)h(my-list\))332 5342 y Ft(wher)m(e)45
b Fp(list->stream)h Ft(is)881 5777 y Fp(\(lambda)110
b(\(list\))1099 6015 y(\(if)g(\(null?)f(list\))1536 6253
y(\(values)g('ignored)h(#f\))1536 6491 y(\(values)f(\(car)h(list\))f
(\(cdr)h(list\)\)\)\))332 7074 y Fg(5.18.4)197 b(Synchronous)49
b(sequences)332 7452 y Ft(When)60 b(using)f(the)i(sequence)e(types)i
(described)e(above,)64 b(a)c(loop)h(terminates)f(when)f(any)h(of)g(its)
332 7678 y(sequences)45 b(r)m(eaches)g(its)i(end.)57
b(T)-17 b(o)47 b(help)f(detect)h(bugs)e(it)h(is)g(useful)e(to)j(have)e
(sequence)g(types)i(that)332 7903 y(check)37 b(to)g(see)h(if)e(two)i
(or)f(mor)m(e)g(sequences)f(end)h(on)h(the)f(same)g(iteration.)54
b(For)37 b(this)h(purpose)f(ther)m(e)332 8129 y(is)69
b(second)h(set)g(of)f(sequence)g(types)h(called)f(synchr)m(onous)g
(sequences.)128 b(These)70 b(ar)m(e)e(identical)332 8355
y(to)g(the)f(ones)g(listed)h(above)e(except)h(that)h(they)f(cause)g(an)
f(err)m(or)h(to)g(be)g(signalled)g(if)f(a)h(loop)h(is)332
8581 y(terminated)i(by)f(a)h(synchr)m(onous)f(sequence)g(and)h(some)g
(other)g(synchr)m(onous)f(sequence)g(did)332 8807 y(not)46
b(r)m(each)e(its)i(end)g(on)f(the)h(same)f(iteration.)614
9045 y(Sequences)52 b(ar)m(e)e(checked)h(for)g(termination)g(in)h(or)m
(der)-13 b(,)52 b(fr)m(om)e(left)i(to)g(right,)h(and)e(if)g(a)g(loop)h
(is)332 9270 y(terminated)45 b(by)g(a)h(non-synchr)m(onous)e(sequence)h
(no)g(further)g(checking)f(is)i(done.)614 9508 y(The)g(synchr)m(onous)f
(sequences)g(ar)m(e:)368 9898 y Fl(\017)91 b Fp(\(list\045)h
Fs(elt-var)c(list)p Fp(\))4430 b Ft(syntax)368 10124
y Fl(\017)91 b Fp(\(vector\045)h Fs(elt-var)d(vector)p
Fp(\))3996 b Ft(syntax)368 10350 y Fl(\017)91 b Fp(\(string\045)h
Fs(elt-var)d(string)p Fp(\))3999 b Ft(syntax)368 10576
y Fl(\017)91 b Fp(\(count\045)h Fs(elt-var)c(start)i(end)g
Fp([)p Fs(step)p Fp(]\))3255 b Ft(syntax)368 10801 y
Fl(\017)91 b Fp(\(input\045)h Fs(elt-var)c(input-port)h(r)m(ead-pr)m
(ocedur)m(e)p Fp(\))2608 b Ft(syntax)368 11027 y Fl(\017)91
b Fp(\(stream\045)h Fs(elt-var)d(pr)m(ocedur)m(e)f(initial-data)p
Fp(\))2819 b Ft(syntax)614 11417 y(Note)47 b(that)g(the)f(synchr)m
(onous)f Fp(count\045)i Ft(must)f(have)g(an)f Fs(end)p
Ft(,)i(unlike)f(the)g(nonsynchr)m(onous)332 11643 y Fp(count\045)p
Ft(.)3661 12141 y(46)p eop end
%%Page: 47 55
TeXDict begin 47 54 bop 166 1146 a Fg(5.18.5)197 b(Examples)166
1523 y Ft(Gathering)45 b(the)h(indexes)f(of)g(list)h(elements)f(that)h
(answer)f(tr)o(ue)g(to)h(some)f(pr)m(edicate.)497 1955
y Fp(\(lambda)109 b(\(my-list)h(predicate\))715 2192
y(\(reduce)g(\(\(list*)f(elt)h(my-list\))1697 2430 y(\(count*)f(i)h
(0\)\))1588 2667 y(\(\(hits)f('\(\)\)\))933 2904 y(\(if)g(\(predicate)h
(elt\))1369 3142 y(\(cons)g(i)f(hits\))1369 3379 y(hits\))933
3616 y(\(reverse)h(hits\)\))166 4037 y Ft(Looking)46
b(for)f(the)h(index)f(of)g(an)g(element)h(of)f(a)g(list.)497
4470 y Fp(\(lambda)109 b(\(my-list)h(predicate\))715
4707 y(\(iterate)g(loop)1697 4944 y(\(\(list*)f(elt)h(my-list\))1806
5182 y(\(count*)g(i)f(0\)\))1697 5419 y(\(\))3491 b(;)109
b(no)g(state)933 5656 y(\(if)g(\(predicate)h(elt\))1369
5893 y(i)1369 6131 y(\(loop\)\)\)\))166 6552 y Ft(Reading)46
b(one)f(line.)497 6984 y Fp(\(define)109 b(\(read-line)h(port\))715
7222 y(\(iterate)g(loop)1697 7459 y(\(\(input*)g(c)f(port)g
(read-char\)\))1697 7696 y(\(\(chars)g('\(\)\)\))933
7934 y(\(if)g(\(char=?)h(c)f(#\\newline\))1369 8171 y(\(list->string)i
(\(reverse)f(chars\)\))1369 8408 y(\(loop)g(\(cons)g(c)f(chars\)\)\))
933 8645 y(\(if)g(\(null?)h(chars\))1369 8883 y(\(eof-object\))1369
9120 y(;)g(no)f(newline)h(at)f(end)g(of)h(file)1369 9357
y(\(list->string)h(\(reverse)f(chars\)\)\)\)\))166 9778
y Ft(Counting)58 b(the)g(lines)g(in)g(a)g(\002le.)95
b(W)-17 b(e)58 b(can't)f(use)h Fp(count*)h Ft(because)e(we)h(need)g
(the)h(value)e(of)h(the)166 10004 y(count)45 b(after)g(the)h(loop)g
(has)f(\002nished.)497 10437 y Fp(\(define)109 b(\(line-count)i(name\))
715 10674 y(\(call-with-input-file)g(name)933 10911 y(\(lambda)f
(\(in\))1151 11148 y(\(reduce)g(\(\(input*)g(l)f(in)g(read-line\)\))
2024 11386 y(\(\(i)g(0\)\))1369 11623 y(\(+)h(i)f(1\)\)\)\)\))3495
12141 y Ft(47)p eop end
%%Page: 48 56
TeXDict begin 48 55 bop 332 1146 a Fg(5.18.6)197 b(De\002ning)49
b(sequence)g(types)332 1506 y Ft(The)87 b(sequence)e(types)i(ar)m(e)f
(object-oriented)f(macr)m(os)h(similar)f(to)i(enumerations.)178
b(A)87 b(non-)332 1732 y(synchr)m(onous)46 b(sequence)h(macr)m(o)f
(needs)h(to)g(supply)h(thr)m(ee)e(values:)60 b Fp(#f)47
b Ft(to)g(indicate)g(that)g(it)g(isn't)332 1958 y(synchr)m(onous,)60
b(a)c(list)i(of)e(state)i(variables)e(and)g(their)h(initializers,)j
(and)d(the)g(code)g(for)g(one)g(iter)m(-)332 2183 y(ation.)96
b(The)58 b(\002rst)h(two)f(methods)g(ar)m(e)g(CPS'ed:)83
b(they)58 b(take)h(another)f(macr)m(o)f(and)h(ar)m(gument)g(to)332
2409 y(which)64 b(to)i(pass)g(their)f(r)m(esult.)116
b(The)66 b Fp(synchronized?)117 b Ft(method)66 b(gets)f(no)h
(additional)f(ar)m(gu-)332 2635 y(ments.)56 b(The)43
b Fp(state-vars)h Ft(method)f(is)g(passed)h(a)f(list)g(of)g(names)f
(which)g(will)g(be)h(bound)f(to)i(the)332 2861 y(ar)m(guments)j(to)h
(the)g(sequence.)64 b(The)48 b(\002nal)f(method,)i(for)f(the)g(step,)i
(is)d(passed)i(the)f(list)g(of)g(names)332 3087 y(bound)k(to)g(the)h
(ar)m(guments)e(and)h(the)g(list)g(of)g(state)h(variables.)76
b(In)52 b(addition)g(ther)m(e)g(is)g(a)g(variable)332
3313 y(to)42 b(be)e(bound)h(to)g(the)g(next)g(element)g(of)g(the)g
(sequence,)g(the)h(body)f(expr)m(ession)f(for)h(the)g(loop,)i(and)332
3538 y(an)i(expr)m(ession)h(for)f(terminating)g(the)g(loop.)614
3767 y(The)h(de\002nition)g(of)f Fp(list*)h Ft(is)663
4159 y Fp(\(define-syntax)110 b(list*)881 4388 y(\(syntax-rules)g
(\(synchronized?)h(state-vars)f(step\))1099 4617 y(\(\(list*)g
(synchronized?)g(\(next)g(more\)\))1208 4846 y(\(next)g(#f)f(more\)\))
1099 5075 y(\(\(list*)h(state-vars)g(\(start-list\))g(\(next)g
(more\)\))1208 5304 y(\(next)g(\(\(list-var)g(start-list\)\))g
(more\)\))1099 5533 y(\(\(list*)g(step)f(\(start-list\))i(\(list-var\))
1972 5762 y(value-var)f(loop-body)g(final-exp\))1208
5991 y(\(if)g(\(null?)f(list-var\))1645 6220 y(final-exp)1645
6449 y(\(let)g(\(\(value-var)h(\(car)g(list-var\)\))2299
6678 y(\(list-var)g(\(cdr)g(list-var\)\)\))1863 6907
y(loop-body\)\)\)\)\))614 7295 y Ft(Synchr)m(onized)44
b(sequences)g(ar)m(e)g(the)h(same,)g(except)f(that)h(they)g(need)f(to)h
(pr)m(ovide)g(a)f(termina-)332 7521 y(tion)i(test)g(to)g(be)f(used)g
(when)g(some)h(other)f(synchr)m(onized)g(method)h(terminates)f(the)g
(loop.)663 7913 y Fp(\(define-syntax)110 b(list\045)881
8142 y(\(syntax-rules)g(\(sync)g(done\))1099 8371 y(\(\(list\045)g
(sync)f(\(next)h(more\)\))1208 8600 y(\(next)g(#t)f(more\)\))1099
8829 y(\(\(list\045)h(done)f(\(start-list\))i(\(list-var\)\))1208
9058 y(\(null?)f(list-var\)\))1099 9287 y(\(\(list\045)g(stuff)f(...\))
1208 9516 y(\(list*)h(stuff)f(...\)\)\)\))332 10045 y
Fg(5.18.7)197 b(Expanded)48 b(code)332 10405 y Ft(The)e(expansion)f(of)
881 10797 y Fp(\(reduce)110 b(\(\(list*)f(x)h('\(1)f(2)g(3\)\)\))1754
11026 y(\(\(r)g('\(\)\)\))1099 11255 y(\(cons)h(x)f(r\)\))332
11643 y Ft(is)3661 12141 y(48)p eop end
%%Page: 49 57
TeXDict begin 49 56 bop 715 1146 a Fp(\(let)109 b(\(\(final)h(\(lambda)
g(\(r\))f(\(values)h(r\)\)\))1369 1376 y(\(list)g('\(1)f(2)h(3\)\))1369
1606 y(\(r)g('\(\)\)\))933 1836 y(\(let)g(loop)f(\(\(list)h(list\))f
(\(r)g(r\)\))1151 2066 y(\(if)h(\(null?)f(list\))1588
2296 y(\(final)g(r\))1588 2527 y(\(let)g(\(\(x)g(\(car)h(list\)\))2242
2757 y(\(list)g(\(cdr)f(list\)\)\))1806 2987 y(\(let)g(\(\(continue)h
(\(lambda)g(\(r\))3769 3217 y(\(loop)g(list)f(r\)\)\)\))2024
3447 y(\(continue)h(\(cons)f(x)h(r\)\)\)\)\)\)\))448
3840 y Ft(The)42 b(only)f(inef)m(\002ciencies)e(in)h(this)h(code)g(ar)m
(e)g(the)g Fp(final)g Ft(and)g Fp(continue)h Ft(pr)m(ocedur)m(es,)f
(both)166 4066 y(of)51 b(which)f(could)h(be)f(substituted)h(in-line.)73
b(The)52 b(macr)m(o)e(expander)h(could)g(do)g(the)g(substitution)166
4291 y(for)60 b Fp(continue)i Ft(when)e(ther)m(e)h(is)g(no)f(explicit)h
(pr)m(oceed)g(variable,)j(as)d(in)f(this)h(case,)k(but)60
b(not)h(in)166 4517 y(general.)166 5141 y Fm(5.19)238
b(Sorting)59 b(lists)g(and)g(vectors)166 5572 y Ft(\(This)53
b(section,)j(as)e(the)g(libraries)e(it)i(describes,)h(was)e(written)h
(mostly)f(by)g(Olin)g(Shivers)h(for)f(the)166 5798 y(draft)45
b(of)g(SRFI)i(32.\))448 6028 y(The)f(sort)g(libraries)e(in)i(Scheme)f
(48)g(include)439 6420 y Fl(\017)91 b Ft(vector)45 b(insert)g(sort)h
(\(stable\))439 6813 y Fl(\017)91 b Ft(vector)45 b(heap)g(sort)439
7206 y Fl(\017)91 b Ft(vector)45 b(mer)m(ge)g(sort)h(\(stable\))439
7598 y Fl(\017)91 b Ft(pur)m(e)45 b(and)g(destr)o(uctive)g(list)g(mer)m
(ge)g(sort)h(\(stable\))439 7991 y Fl(\017)91 b Ft(stable)45
b(vector)g(and)g(list)h(mer)m(ge)439 8383 y Fl(\017)91
b Ft(miscellaneous)70 b(sort-r)m(elated)h(pr)m(ocedur)m(es:)108
b(vector)71 b(and)h(list)f(mer)m(ging,)78 b(sorted)72
b(pr)m(edi-)621 8609 y(cates,)46 b(vector)f(binary)f(sear)m(ch,)i
(vector)f(and)g(list)h(delete-equal-neighbor)e(pr)m(ocedur)m(es.)439
9002 y Fl(\017)91 b Ft(a)40 b(general,)i(non-algorithmic)d(set)h(of)h
(pr)m(ocedur)m(e)e(names)h(for)g(general)g(sorting)h(and)f(mer)m(g-)621
9228 y(ing)166 9764 y Fg(5.19.1)197 b(Design)50 b(rules)166
10126 y Fq(What)56 b(vs.)91 b(how)183 b Ft(Ther)m(e)57
b(ar)m(e)f(two)h(dif)m(fer)m(ent)f(interfaces:)79 b(\223what\224)56
b(\(simple\))g(and)g(\223how\224)h(\(de-)166 10352 y(tailed\).)166
10799 y Fq(Simple)90 b Ft(you)45 b(specify)g(semantics:)57
b(datatype)46 b(\(list)f(or)h(vector\),)f(mutability)-20
b(,)45 b(and)g(stability)-20 b(.)166 11191 y Fq(Detailed)90
b Ft(you)38 b(specify)f(the)h(actual)f(algorithm)g(\(quick,)i(heap,)g
(insert,)h(mer)m(ge\).)53 b(Dif)m(fer)m(ent)36 b(algo-)621
11417 y(rithms)46 b(have)h(dif)m(fer)m(ent)f(pr)m(operties,)j(both)e
(semantic)g(and)g(pragmatic,)h(so)g(these)f(exports)621
11643 y(ar)m(e)e(necessary)-20 b(.)3495 12141 y(49)p
eop end
%%Page: 50 58
TeXDict begin 50 57 bop 787 1146 a Ft(It)55 b(is)h(necessarily)f(the)g
(case)g(that)h(the)f(speci\002cations)h(of)f(these)g(pr)m(ocedur)m(es)g
(make)g(state-)787 1372 y(ments)46 b(about)h(execution)f
(\223pragmatics.\224)60 b(For)47 b(example,)h(the)f(sole)g(distinction)
g(between)787 1597 y(heap)c(sort)i(and)e(quick)g(sort\227both)h(of)g
(which)e(ar)m(e)h(pr)m(ovided)h(by)f(this)h(library\227-is)e(one)i(of)
787 1823 y(execution)38 b(time,)h(which)f(is)g(not)h(a)f
(\223semantic\224)f(distinction.)55 b(Similar)37 b(r)m(esour)m(ce-use)g
(state-)787 2049 y(ments)44 b(ar)m(e)g(made)g(about)g
(\223iterative\224)h(pr)m(ocedur)m(es,)f(meaning)g(that)h(they)g(can)f
(execute)g(on)787 2275 y(input)h(of)g(arbitrary)g(size)g(in)g(a)h
(constant)f(number)f(of)i(stack)f(frames.)332 2774 y
Fq(Consistency)51 b(across)g(procedure)h(signatures)180
b Ft(The)53 b(two)f(interfaces)g(shar)m(e)f(common)h(pr)m(oce-)332
3000 y(dur)m(e)44 b(signatur)m(es)g(wher)m(ever)f(possible,)i(to)g
(facilitate)f(switching)g(a)g(given)g(call)g(fr)m(om)f(one)i(pr)m(oce-)
332 3226 y(dur)m(e)g(to)h(another)-13 b(.)332 3725 y
Fq(Less-than)77 b(parameter)g(\002rst,)86 b(data)78 b(parameter)f
(after)181 b Ft(These)79 b(pr)m(ocedur)m(es)f(uniformly)f(ob-)332
3951 y(serve)41 b(the)g(following)f(parameter)g(or)m(der:)55
b(the)41 b(data)f(to)i(be)e(sorted)i(comes)e(after)h(the)f(comparison)
332 4176 y(pr)m(ocedur)m(e.)56 b(That)46 b(is,)g(we)f(write)881
4580 y Fp(\(sort)110 b Fh(<)f Fs(list)n Fp(\))614 4983
y Ft(not)881 5386 y Fp(\(sort)h Fs(list)d Fh(<)p Fp(\))332
5885 y Fq(Ordering,)70 b(comparison)63 b(procedures)h(and)h(stability)
179 b Ft(These)66 b(r)m(outines)e(take)h(a)g Fh(<)g Ft(compar)m(-)332
6111 y(ison)d(pr)m(ocedur)m(e,)j(not)d(a)g Fl(\024)g
Ft(comparison)g(pr)m(ocedur)m(e,)j(and)d(they)g(sort)g(into)g(incr)m
(easing)e(or)m(der)-13 b(.)332 6337 y(The)46 b(dif)m(fer)m(ence)e
(between)h(a)g Fh(<)h Ft(spec)f(and)h(a)f Fl(\024)h Ft(spec)g(comes)f
(up)g(in)g(two)h(places:)605 6740 y Fl(\017)91 b Ft(the)45
b(de\002nition)h(of)f(an)g(or)m(der)m(ed)h(or)f(sorted)h(data)g(set,)g
(and)605 7108 y Fl(\017)91 b Ft(the)45 b(de\002nition)h(of)f(a)h
(stable)f(sorting)h(algorithm.)614 7511 y(W)-17 b(e)49
b(say)f(that)h(a)f(data)h(set)f(\(a)g(list)h(or)f(vector\))g(is)g
Fs(sorted)f Ft(or)h Fs(order)m(ed)f Ft(if)h(it)g(contains)g(no)h
(adjacent)332 7737 y(pair)c(of)h(values)f Fh(:)30 b(:)g(:)f(x;)h(y)37
b(:)30 b(:)g(:)44 b Ft(such)h(that)h Fh(y)57 b(<)51 b(x)p
Ft(.)614 7963 y(In)46 b(other)g(wor)m(ds,)f(scanning)g(acr)m(oss)g(the)
h(data)f(never)g(takes)h(a)f(\223downwar)m(ds\224)g(step.)614
8189 y(If)52 b(you)g(use)g(a)g Fl(\024)h Ft(pr)m(ocedur)m(e)e(wher)m(e)
h(these)g(algorithms)g(expect)g(a)g Fh(<)h Ft(pr)m(ocedur)m(e,)g(you)g
(may)332 8414 y(not)67 b(get)h(the)f(answers)f(you)h(expect.)122
b(For)67 b(example,)72 b(the)c Fp(list-sorted?)122 b
Ft(pr)m(ocedur)m(e)66 b(will)332 8640 y(r)m(eturn)60
b(false)f(if)h(you)g(pass)h(it)g(a)f Fl(\024)g Ft(comparison)g(pr)m
(ocedur)m(e)g(and)g(an)g(or)m(der)m(ed)g(list)h(containing)332
8866 y(adjacent)45 b(equal)g(elements.)614 9092 y(A)f(\223stable\224)e
(sort)h(is)g(one)g(that)g(pr)m(eserves)g(the)g(pr)m(e-existing)f(or)m
(der)h(of)f(equal)g(elements.)56 b(Sup-)332 9318 y(pose,)c(for)e
(example,)h(that)g(we)e(sort)i(a)f(list)g(of)g(numbers)f(by)g
(comparing)h(their)g(absolute)f(values,)332 9544 y(i.e.,)e(using)e
(comparison)g(pr)m(ocedur)m(e)332 9901 y Fp(\(lambda)110
b(\(x)f(y\))g(\(<)h(\(abs)f(x\))g(\(abs)h(y\)\)\))332
10258 y Ft(If)45 b(we)h(sort)f(a)h(list)f(that)h(contains)f(both)h(3)f
(and)g(-3:)3146 10644 y Fh(:)30 b(:)g(:)f Fi(3)p Fh(;)h(:)g(:)g(:)g(;)g
Fl(\000)p Fi(3)g Fh(:)g(:)g(:)332 11031 y Ft(then)52
b(a)h(stable)f(sort)g(is)h(an)f(algorithm)g(that)g(will)g(not)h(swap)f
(the)g(or)m(der)g(of)h(these)f(two)h(elements,)332 11256
y(that)46 b(is,)g(the)f(answer)g(is)h(guaranteed)f(to)h(to)g(look)g
(like)3308 11643 y Fh(:)30 b(:)g(:)f Fi(3)p Fh(;)h Fl(\000)p
Fi(3)g Fh(:)g(:)g(:)3661 12141 y Ft(50)p eop end
%%Page: 51 59
TeXDict begin 51 58 bop 166 1146 a Ft(not)3116 1372 y
Fh(:)30 b(:)g(:)40 b Fl(\000)h Fi(3)p Fh(;)30 b Fi(3)g
Fh(:)g(:)g(:)166 1658 y Ft(Choosing)47 b Fh(<)g Ft(for)g(the)g
(comparison)f(pr)m(ocedur)m(e)g(instead)h(of)g Fl(\024)g
Ft(af)m(fects)f(how)h(stability)f(is)h(coded.)166 1884
y(Given)69 b(an)h(adjacent)f(pair)g Fh(x;)30 b(y)7 b
Ft(,)76 b Fp(\(<)109 b Fh(y)116 b(x)p Fp(\))70 b Ft(means)f(\223)p
Fh(x)h Ft(should)f(be)h(moved)f(in)h(fr)m(ont)f(of)g
Fh(x)p Ft(\224\227)166 2110 y(otherwise,)60 b(leave)d(things)f(as)h
(they)g(ar)m(e.)90 b(So)58 b(using)e(a)h Fl(\024)g Ft(pr)m(ocedur)m(e)f
(wher)m(e)g(a)h Fh(<)g Ft(pr)m(ocedur)m(e)f(is)166 2335
y(expected)46 b(will)f Fs(invert)f Ft(stability)-20 b(.)448
2561 y(This)46 b(is)f(due)h(to)g(the)f(de\002nition)h(of)f(equality)-20
b(,)46 b(given)f(a)g Fh(<)h Ft(comparator:)602 2858 y
Fp(\(and)110 b(\(not)f(\(<)h(x)f(y\)\))1148 3084 y(\(not)g(\(<)h(y)f
(x\)\)\))166 3380 y Ft(The)46 b(de\002nition)f(is)h(rather)f(dif)m(fer)
m(ent,)g(given)g(a)g Fl(\024)h Ft(comparator:)602 3677
y Fp(\(and)110 b(\(<=)f(x)g(y\))1148 3903 y(\(<=)g(y)g(x\)\))166
4199 y Ft(A)72 b(\223stable\224)f(mer)m(ge)g(is)h(one)g(that)g(r)m
(eliably)e(favors)h(one)h(of)f(its)h(data)g(sets)g(when)f(equal)g
(items)166 4425 y(appear)f(in)f(both)h(data)f(sets.)130
b Fs(All)69 b(mer)m(ge)g(operations)e(in)i(this)f(library)g(ar)m(e)h
(stable)p Ft(,)74 b(br)m(eaking)69 b(ties)166 4651 y(between)54
b(data)h(sets)g(in)f(favor)g(of)g(the)h(\002rst)f(data)h
(set\227elements)g(of)f(the)h(\002rst)f(list)h(come)f(befor)m(e)166
4877 y(equal)45 b(elements)g(in)g(the)h(second)g(list.)448
5102 y(So,)63 b(if)57 b(we)h(ar)m(e)g(mer)m(ging)f(two)h(lists)h(of)f
(numbers)e(or)m(der)m(ed)i(by)g(absolute)g(value,)j(the)d(stable)166
5328 y(mer)m(ge)45 b(operation)h Fp(list-merge)602 5625
y(\(list-merge)110 b(\(lambda)g(\(x)f(y\))h(\(<)f(\(abs)g(x\))h(\(abs)f
(y\)\)\))1911 5851 y('\(0)h(-2)f(4)g(8)g(-10\))h('\(-1)f(3)h(-4)f
(7\)\))166 6147 y Ft(r)m(eliably)44 b(places)i(the)f(4)h(of)f(the)h
(\002rst)f(list)h(befor)m(e)f(the)g(equal-comparing)f(-4)h(of)g(the)h
(second)f(list:)602 6444 y Fp(\(0)110 b(-1)f(-2)g(4)g(-4)h(7)f(8)g
(-10\))166 6740 y Ft(Some)57 b(sort)h(algorithms)f(will)f
Fs(not)h(work)f(corr)m(ectly)f Ft(if)h(given)h(a)g Fl(\024)g
Ft(when)g(they)g(expect)g(a)g Fh(<)h Ft(com-)166 6966
y(parison)46 b(\(or)f(vice-versa\).)448 7192 y(In)h(short,)g(if)f(your)
g(comparison)g(pr)m(ocedur)m(e)g Fh(f)65 b Ft(answers)45
b(tr)o(ue)g(to)h Fp(\()p Fh(f)129 b Fp(x)109 b(x\))p
Ft(,)46 b(then)439 7488 y Fl(\017)91 b Ft(using)64 b(a)g(stable)h
(sorting)g(or)f(mer)m(ging)g(algorithm)g(will)g(not)h(give)f(you)h(a)f
(stable)h(sort)g(or)621 7714 y(mer)m(ge,)439 8058 y Fl(\017)91
b Fp(list-sorted?)57 b Ft(may)45 b(surprise)g(you.)166
8354 y(Note)h(that)g(you)f(can)g(synthesize)h(a)f Fh(<)h
Ft(pr)m(ocedur)m(e)f(fr)m(om)f(a)i Fl(\024)f Ft(pr)m(ocedur)m(e)g(with)
602 8651 y Fp(\(lambda)110 b(\(x)f(y\))h(\(not)f(\(<=)g(y)h(x\)\)\))166
8948 y Ft(if)45 b(need)g(be.)448 9173 y(Pr)m(ecise)65
b(de\002nitions)h(give)g(sharp)g(edges)g(to)g(tools,)72
b(but)65 b(r)m(equir)m(e)g(car)m(e)g(in)g(use.)118 b(\223Measur)m(e)166
9399 y(twice,)46 b(cut)f(once.\224)166 9886 y Fq(All)57
b(vector)f(operations)f(accept)h(optional)g(subrange)g(parameters)180
b Ft(The)58 b(vector)e(operations)166 10112 y(speci\002ed)69
b(below)g(all)g(take)g(optional)h Fp(start)p Ft(/)p Fp(end)g
Ft(ar)m(guments)e(indicating)h(a)g(selected)g(sub-)166
10338 y(range)52 b(of)g(a)g(vector)13 b('s)52 b(elements.)78
b(If)52 b(a)g Fp(start)g Ft(parameter)g(or)h Fp(start)p
Ft(/)p Fp(end)g Ft(parameter)f(pair)g(is)166 10563 y(given)45
b(to)h(such)f(a)g(pr)m(ocedur)m(e,)g(they)h(must)f(be)g(exact,)h
(non-negative)f(integers,)h(such)f(that)1777 10877 y
Fi(0)51 b Fl(\024)g Fs(start)e Fl(\024)h Fs(end)h Fl(\024)g
Fp(\(vector-length)110 b Fs(vector)o Fp(\))166 11191
y Ft(wher)m(e)46 b Fs(vector)f Ft(is)h(the)h(r)m(elated)f(vector)h
(parameter)-13 b(.)59 b(If)46 b(not)h(speci\002ed,)g(they)g(default)f
(to)h(0)g(and)f(the)166 11417 y(length)54 b(of)g(the)g(vector)-13
b(,)55 b(r)m(espectively)-20 b(.)82 b(They)54 b(ar)m(e)g(interpr)m
(eted)g(to)g(select)g(the)g(range)g Fi([)p Fs(start)m
Fh(;)30 b Fs(end)p Fi(\))p Ft(,)166 11643 y(that)46 b(is,)g(all)f
(elements)g(fr)m(om)g(index)g Fs(start)e Ft(\(inclusive\))h(up)h(to,)i
(but)e(not)g(including,)g(index)g Fs(end)p Ft(.)3495
12141 y(51)p eop end
%%Page: 52 60
TeXDict begin 52 59 bop 332 1146 a Fq(Required)70 b(vs.)g(allowed)g
(side-ef)m(fects)178 b Fp(List-sort!)132 b Ft(and)70
b Fp(List-stable-sort!)132 b Ft(ar)m(e)332 1372 y(allowed,)61
b(but)c(not)h(r)m(equir)m(ed,)h(to)f(alter)g(their)f(ar)m(guments')f
(cons)i(cells)f(to)h(constr)o(uct)f(the)h(r)m(esult)332
1597 y(list.)65 b(This)49 b(is)f(consistent)h(with)f(the)g
(what-not-how)f(character)g(of)h(the)h(gr)m(oup)f(of)g(pr)m(ocedur)m
(es)g(to)332 1823 y(which)c(they)i(belong)f(\(the)h Fp(sorting)g
Ft(str)o(uctur)m(e\).)614 2049 y(The)373 b Fp
(list-delete-neighbor-dups!)p Ft(,)457 b Fp(list-merge!)1038
b Ft(and)332 2275 y Fp(list-merge-sort!)141 b Ft(pr)m(ocedur)m(es,)80
b(on)73 b(the)g(other)h(hand,)80 b(pr)m(ovide)73 b(speci\002c)g
(algorithms,)332 2501 y(and,)45 b(as)f(such,)g(explicitly)g(commit)g
(to)h(the)f(use)g(of)g(side-ef)m(fects)f(on)i(their)f(input)g(lists)h
(in)e(or)m(der)i(to)332 2726 y(guarantee)g(their)h(key)f(algorithmic)g
(pr)m(operties)h(\(e.g.,)g(linear)m(-time)e(operation\).)332
3224 y Fg(5.19.2)197 b(Procedure)48 b(speci\002cation)546
3578 y Ft(Str)o(uctur)m(e)d(name)1805 b(Functionality)p
447 3652 6611 7 v 546 3810 a Fp(sorting)2273 b Ft(General)45
b(sorting)g(for)g(lists)h(and)f(vectors)546 4036 y Fp(sorted)2382
b Ft(Sorted)46 b(pr)m(edicates)g(for)f(lists)h(and)f(vectors)546
4262 y Fp(list-merge-sort)1401 b Ft(List)46 b(mer)m(ge)e(sort)546
4488 y Fp(vector-merge-sort)1183 b Ft(V)-20 b(ector)46
b(mer)m(ge)e(sort)546 4713 y Fp(vector-heap-sort)1292
b Ft(V)-20 b(ector)46 b(heap)f(sort)546 4939 y Fp(vector-insert-sort)
1074 b Ft(V)-20 b(ector)46 b(insertion)f(sort)546 5165
y Fp(delete-neighbor-duplicates)202 b Ft(List)46 b(and)f(vector)g
(delete)h(neighbor)f(duplicates)546 5391 y Fp(binary-searches)1401
b Ft(V)-20 b(ector)46 b(binary)e(sear)m(ch)332 5734 y(Note)60
b(that)e(ther)m(e)h(is)g(no)f(\223list)h(insert)g(sort\224)g(package,)k
(as)58 b(you)h(might)f(as)h(well)f(always)g(use)h(list)332
5960 y(mer)m(ge)52 b(sort.)79 b(The)53 b(r)m(efer)m(ence)e
(implementation's)h(destr)o(uctive)g(list)h(mer)m(ge)f(sort)h(will)f
(do)h(fewer)332 6186 y Fp(set-cdr!)p Ft(s)46 b(than)g(a)f(destr)o
(uctive)g(insert)g(sort.)332 6677 y Fq(Procedure)h(naming)g(and)h
(functionality)180 b Ft(Almost)47 b(all)g(of)f(the)h(pr)m(ocedur)m(es)f
(described)h(below)332 6902 y(ar)m(e)h(variants)g(of)h(two)f(basic)g
(operations:)64 b(sorting)49 b(and)f(mer)m(ging.)66 b(These)49
b(pr)m(ocedur)m(es)f(ar)m(e)g(con-)332 7128 y(sistently)e(named)f(by)g
(composing)h(a)f(set)h(of)f(basic)g(lexemes)g(to)h(indicate)f(what)g
(they)h(do.)589 7443 y(Lexeme)227 b(Meaning)p 490 7518
6526 7 v 589 7676 a Fp(sort)418 b Ft(The)49 b(pr)m(ocedur)m(e)g(sorts)g
(its)h(input)f(data)g(set)h(by)e(some)h Fh(<)h Ft(comparison)f(pr)m
(oce-)1443 7901 y(dur)m(e.)589 8127 y Fp(merge)309 b
Ft(The)65 b(pr)m(ocedur)m(e)g(mer)m(ges)g(two)g(or)m(der)m(ed)g(data)g
(sets)h(into)f(a)g(single)g(or)m(der)m(ed)1443 8353 y(r)m(esult.)589
8579 y Fp(stable)200 b Ft(This)46 b(lexeme)f(indicates)g(that)h(the)f
(sort)h(is)g(a)f(stable)g(one.)589 8805 y Fp(vector)200
b Ft(The)46 b(pr)m(ocedur)m(e)f(operates)h(upon)f(vectors.)589
9031 y Fp(list)418 b Ft(The)46 b(pr)m(ocedur)m(e)f(operates)h(upon)f
(lists.)589 9256 y Fp(!)745 b Ft(Pr)m(ocedur)m(es)62
b(that)i(end)f(in)g Fp(!)110 b Ft(ar)m(e)63 b(allowed,)68
b(and)63 b(sometimes)g(r)m(equir)m(ed,)k(to)1443 9482
y(r)m(euse)45 b(their)g(input)h(storage)g(to)g(constr)o(uct)e(their)i
(answer)-13 b(.)332 9964 y Fq(T)d(ypes)45 b(of)h(parameters)d(and)j
(return)e(values)181 b Ft(In)46 b(the)f(pr)m(ocedur)m(es)g(speci\002ed)
h(below)-17 b(,)605 10279 y Fl(\017)91 b Ft(A)39 b Fp(<)g
Ft(or)g Fp(=)g Ft(parameter)g(is)g(a)g(pr)m(ocedur)m(e)f(accepting)h
(two)g(ar)m(guments)f(taken)h(fr)m(om)f(the)h(spec-)787
10504 y(i\002ed)45 b(pr)m(ocedur)m(e's)g(data)g(set\(s\),)h(and)f(r)m
(eturning)f(a)i(boolean;)605 10855 y Fl(\017)91 b Fp(Start)44
b Ft(and)g Fp(end)g Ft(parameters)g(ar)m(e)g(exact,)g(non-negative)g
(integers)g(that)g(serve)g(as)g(vector)787 11081 y(indices)67
b(selecting)h(a)g(subrange)f(of)h(some)g(associated)g(vector)-13
b(.)124 b(When)67 b(speci\002ed,)75 b(they)787 11307
y(must)45 b(satisfy)g(the)h(r)m(elation)2171 11643 y
Fi(0)k Fl(\024)h Fs(start)e Fl(\024)i Fs(end)f Fl(\024)h
Fp(\(vector-length)110 b Fs(vector)o Fp(\))3661 12141
y Ft(52)p eop end
%%Page: 53 61
TeXDict begin 53 60 bop 621 1146 a Ft(wher)m(e)44 b Fs(vector)g
Ft(is)i(the)f(associated)h(vector)-13 b(.)166 1549 y(Passing)51
b(values)g(to)h(pr)m(ocedur)m(es)e(with)h(these)h(parameters)f(that)h
(do)f(not)h(satisfy)f(these)h(types)g(is)166 1774 y(an)45
b(err)m(or)-13 b(.)448 2007 y(If)71 b(a)h(pr)m(ocedur)m(e)e(is)h(said)h
(to)g(r)m(eturn)e(\223unspeci\002ed,\224)78 b(this)71
b(means)g(that)g(nothing)h(at)f(all)g(is)166 2233 y(said)58
b(about)f(what)g(the)h(pr)m(ocedur)m(e)f(r)m(eturns,)k(not)d(even)f
(the)h(number)e(of)i(r)m(eturn)f(values.)92 b(Such)166
2459 y(a)69 b(pr)m(ocedur)m(e)g(is)g(not)h(even)f(r)m(equir)m(ed)e(to)j
(be)f(consistent)h(fr)m(om)e(call)h(to)g(call)g(in)g(the)g(natur)m(e)g
(or)166 2685 y(number)36 b(of)i(its)g(r)m(eturn)f(values.)54
b(It)38 b(is)g(simply)f(r)m(equir)m(ed)g(to)h(r)m(eturn)f(a)h(value)f
(\(or)h(values\))e(that)i(may)166 2911 y(be)44 b(passed)h(to)f(a)g
(command)f(continuation,)i(e.g.)57 b(as)44 b(the)g(value)g(of)g(an)g
(expr)m(ession)g(appearing)g(as)166 3136 y(a)51 b(non-terminal)e
(subform)g(of)i(a)g Fp(begin)g Ft(expr)m(ession.)73 b(Note)51
b(that)g(in)g(R)5210 3070 y Fn(5)5289 3136 y Ft(RS,)h(this)f(r)m
(estricts)g(such)166 3362 y(a)46 b(pr)m(ocedur)m(e)f(to)i(r)m(eturning)
d(a)i(single)g(value;)g(non-R)3870 3296 y Fn(5)3949 3362
y Ft(RS)h(systems)f(may)f(not)h(even)g(pr)m(ovide)g(this)166
3588 y(r)m(estriction.)166 4133 y Fe(sorting)p Fq(\227general)f
(sorting)f(package)166 4501 y Ft(This)e(library)f(pr)m(ovides)h(basic)f
(sorting)h(and)g(mer)m(ging)f(functionality)g(suitable)g(for)h(general)
f(pr)m(o-)166 4727 y(gramming.)55 b(The)44 b(pr)m(ocedur)m(es)f(ar)m(e)
g(named)h(by)f(their)h(semantic)f(pr)m(operties,)i(i.e.,)g(what)f(they)
g(do)166 4953 y(to)i(the)g(data)f(\(sort,)h(stable)f(sort,)i(mer)m(ge,)
e(and)g(so)h(forth\).)202 5323 y Fl(\017)91 b Fp(\(list-sorted?)103
b Fh(<)92 b Fs(list)p Fp(\))d Fl(!)i Fs(boolean)202 5548
y Fl(\017)g Fp(\(list-merge)h Fh(<)f Fs(list)2141 5575
y Fn(1)2310 5548 y Fs(list)2544 5575 y Fn(2)2621 5548
y Fp(\))g Fl(!)g Fs(list)202 5774 y Fl(\017)g Fp(\(list-merge!)103
b Fh(<)91 b Fs(list)2261 5801 y Fn(1)2430 5774 y Fs(list)2664
5801 y Fn(2)2741 5774 y Fp(\))g Fl(!)g Fs(list)202 6000
y Fl(\017)g Fp(\(list-sort)h Fh(<)f Fs(lis)p Fp(\))f
Fl(!)h Fs(list)202 6226 y Fl(\017)g Fp(\(list-sort!)103
b Fh(<)91 b Fs(lis)p Fp(\))f Fl(!)h Fs(list)202 6452
y Fl(\017)g Fp(\(list-stable-sort)i Fh(<)e Fs(list)p
Fp(\))e Fl(!)i Fs(list)202 6677 y Fl(\017)g Fp(\(list-stable-sort!)104
b Fh(<)91 b Fs(list)p Fp(\))e Fl(!)i Fs(list)202 6903
y Fl(\017)g Fp(\(list-delete-neighbor-dups)i Fi(=)f Fs(list)p
Fp(\))d Fl(!)i Fs(list)202 7129 y Fl(\017)g Fp(\(vector-sorted?)103
b Fh(<)92 b Fs(v)f([start)d([end]])p Fp(\))i Fl(!)g Fs(boolean)202
7355 y Fl(\017)h Fp(\(vector-merge)h Fh(<)g Fs(v)2217
7382 y Fn(1)2386 7355 y Fs(v)2477 7382 y Fn(2)2647 7355
y Fs([start)p Fi(1)d Fs([end)p Fi(1)h Fs([start)p Fi(2)e
Fs([end)p Fi(2)p Fs(]]]])p Fp(\))h Fl(!)h Fs(vector)202
7581 y Fl(\017)h Fp(\(vector-merge!)h Fh(<)g Fs(v)f(v)2508
7608 y Fn(1)2677 7581 y Fs(v)2768 7608 y Fn(2)2938 7581
y Fs([start)e([start)p Fi(1)f Fs([end)p Fi(1)i Fs([start)p
Fi(2)f Fs([end)p Fi(2)p Fs(]]]]])p Fp(\))202 7807 y Fl(\017)i
Fp(\(vector-sort)h Fh(<)g Fs(v)e([start)f([end]])p Fp(\))g
Fl(!)i Fs(vector)202 8032 y Fl(\017)g Fp(\(vector-sort!)h
Fh(<)g Fs(v)e([start)f([end]])p Fp(\))202 8258 y Fl(\017)i
Fp(\(vector-stable-sort)i Fh(<)e Fs(v)g([start)e([end]])p
Fp(\))g Fl(!)i Fs(vector)202 8484 y Fl(\017)g Fp(\(vector-stable-sort!)
i Fh(<)e Fs(v)g([start)e([end]])p Fp(\))202 8710 y Fl(\017)i
Fp(\(vector-delete-neighbor-dups)j Fi(=)d Fs(v)g([start)e([end]])p
Fp(\))g Fl(!)i Fs(vector)1159 9153 y Ft(Pr)m(ocedur)m(e)2362
b(Suggested)47 b(algorithm)p 1059 9228 5054 7 v 1159
9386 a Fp(list-sort)2204 b Ft(vector)46 b(heap)f(or)h(quick)1159
9612 y Fp(list-sort!)2095 b Ft(list)46 b(mer)m(ge)f(sort)1159
9837 y Fp(list-stable-sort)1441 b Ft(vector)46 b(mer)m(ge)f(sort)1159
10063 y Fp(list-stable-sort!)1332 b Ft(list)46 b(mer)m(ge)f(sort)1159
10289 y Fp(vector-sort)1986 b Ft(heap)46 b(or)f(quick)g(sort)1159
10515 y Fp(vector-sort!)57 b Ft(or)46 b(quick)e(sort)1159
10741 y Fp(vector-stable-sort)1223 b Ft(vector)46 b(mer)m(ge)f(sort)
1159 10967 y Fp(vector-stable-sort!)58 b Ft(mer)m(ge)45
b(sort)166 11417 y Fp(List-Sorted?)89 b Ft(and)56 b Fp(vector-sorted?)
90 b Ft(r)m(eturn)55 b(tr)o(ue)g(if)h(their)g(input)g(list)g(or)g
(vector)g(is)g(in)166 11643 y(sorted)46 b(or)m(der)-13
b(,)45 b(as)h(determined)f(by)g(their)h Fh(<)f Ft(comparison)h
(parameter)-13 b(.)3495 12141 y(53)p eop end
%%Page: 54 62
TeXDict begin 54 61 bop 614 1146 a Ft(All)64 b(four)e(mer)m(ge)g
(operations)i(ar)m(e)f(stable:)91 b(an)63 b(element)g(of)g(the)g
(initial)g(list)g Fs(list)6297 1173 y Fn(1)6437 1146
y Ft(or)g(vector)332 1372 y Fs(vector)781 1399 y Fn(1)910
1372 y Ft(will)50 b(come)h(befor)m(e)f(an)g(equal-comparing)g(element)h
(in)f(the)i(second)f(list)g Fs(list)6321 1399 y Fn(2)6449
1372 y Ft(or)g(vector)332 1597 y Fs(vector)781 1624 y
Fn(2)904 1597 y Ft(in)45 b(the)h(r)m(esult.)614 1828
y(The)g(pr)m(ocedur)m(es)605 2225 y Fl(\017)91 b Fp(list-merge)605
2621 y Fl(\017)g Fp(list-sort)605 3017 y Fl(\017)g Fp(list-stable-sort)
605 3414 y Fl(\017)g Fp(list-delete-neighbor-dups)332
3810 y Ft(do)53 b(not)g(alter)g(their)f(inputs)h(and)f(ar)m(e)h
(allowed)f(to)h(r)m(eturn)f(a)h(value)f(that)h(shar)m(es)f(a)g(common)g
(tail)332 4036 y(with)45 b(a)h(list)f(ar)m(gument.)614
4267 y(The)h(pr)m(ocedur)m(e)605 4663 y Fl(\017)91 b
Fp(list-sort!)605 5059 y Fl(\017)g Fp(list-stable-sort!)332
5456 y Ft(ar)m(e)61 b(\223linear)f(update\224)i(operators\227they)g(ar)
m(e)f(allowed,)k(but)c(not)g(r)m(equir)m(ed,)k(to)d(alter)f(the)g(cons)
332 5681 y(cells)45 b(of)h(their)f(ar)m(guments)f(to)i(pr)m(oduce)f
(their)h(r)m(esults.)614 5912 y(On)65 b(the)h(other)g(hand,)k(the)c
Fp(list-merge!)117 b Ft(pr)m(ocedur)m(e)64 b(make)h(only)h(a)f(single,)
71 b(iterative,)332 6138 y(linear)m(-time)48 b(pass)i(over)f(its)g(ar)m
(gument)f(list,)j(using)e Fp(set-cdr!)p Ft(s)h(to)g(r)m(earrange)e(the)
i(cells)f(of)g(the)332 6364 y(list)57 b(into)g(the)g(\002nal)g(r)m
(esult)g(\227it)f(works)h(\223in)g(place.\224)91 b(Hence,)60
b(any)d(cons)g(cell)f(appearing)h(in)g(the)332 6590 y(r)m(esult)37
b(must)h(have)f(originally)h(appear)m(ed)g(in)f(an)h(input.)54
b(The)38 b(intent)g(of)g(this)g(iterative-algorithm)332
6816 y(commitment)e(is)h(to)g(allow)g(the)g(pr)m(ogrammer)f(to)h(be)g
(sur)m(e)f(that)h(if,)i(for)d(example,)j Fp(list-merge!)332
7042 y Ft(is)55 b(asked)f(to)i(mer)m(ge)e(two)g(ten-million-element)f
(lists,)58 b(the)c(operation)i(will)e(complete)g(without)332
7267 y(performing)45 b(some)g(extr)m(emely)g(\(possibly)g
(twenty-million\))f(deep)i(r)m(ecursion.)614 7498 y(The)g(vector)g(pr)m
(ocedur)m(es)605 7895 y Fl(\017)91 b Fp(vector-sort)605
8291 y Fl(\017)g Fp(vector-stable-sort)605 8687 y Fl(\017)g
Fp(vector-delete-neighbor-dups)332 9084 y Ft(do)39 b(not)h(alter)f
(their)f(inputs,)j(but)e(allocate)g(a)f(fr)m(esh)g(vector)h(for)g
(their)g(r)m(esult,)h(of)f(length)g Fs(end)16 b Fl(\000)g
Fs(start)o Ft(.)614 9315 y(The)46 b(vector)g(pr)m(ocedur)m(es)605
9711 y Fl(\017)91 b Fp(vector-sort!)605 10107 y Fl(\017)g
Fp(vector-stable-sort!)332 10503 y Ft(sort)47 b(their)g(data)g
(in-place.)60 b(\(But)46 b(note)i(that)f Fp(vector-stable-sort!)62
b Ft(may)46 b(allocate)h(tempo-)332 10729 y(rary)e(storage)h(pr)m
(oportional)g(to)g(the)g(size)f(of)h(the)f(input)g(.\))614
10960 y Fp(Vector-merge)i Ft(r)m(eturns)e(a)g(vector)g(of)h(length)f
Fi(\()p Fs(end)4373 10987 y Fn(1)4492 10960 y Fl(\000)c
Fs(start)5019 10987 y Fn(1)5136 10960 y Fi(+)g(\()p Fs(end)5652
10987 y Fn(2)5771 10960 y Fl(\000)f Fs(start)6297 10987
y Fn(2)6375 10960 y Fi(\))p Ft(.)614 11191 y Fp(Vector-merge!)54
b Ft(writes)35 b(its)g(r)m(esult)f(into)h(vector)g Fs(v)p
Ft(,)i(beginning)d(at)h(index)f Fs(start)o Ft(,)j(for)d(indices)332
11417 y(less)41 b(than)g Fs(end)51 b Fi(=)g Fs(start)22
b Fi(+)i(\()p Fs(end)2442 11444 y Fn(1)2546 11417 y Fl(\000)g
Fs(start)3056 11444 y Fn(1)3134 11417 y Fi(\))g(+)g(\()p
Fs(end)3728 11444 y Fn(2)3832 11417 y Fl(\000)g Fs(start)4342
11444 y Fn(2)4420 11417 y Fi(\))p Ft(.)55 b(The)42 b(tar)m(get)f
(subvector)f Fs(v)p Fi([)p Fs(start)n Fh(;)30 b Fs(end)o
Fi(\))332 11643 y Ft(may)45 b(not)h(overlap)f(either)h(sour)m(ce)f
(subvector)f Fs(vector)4059 11670 y Fn(1)4137 11643 y
Fi([)p Fs(start)4533 11670 y Fn(1)4609 11643 y Fh(;)30
b Fs(end)4953 11670 y Fn(1)5032 11643 y Fi(\))45 b Fs(vector)5597
11670 y Fn(2)5674 11643 y Fi([)p Fs(start)6070 11670
y Fn(2)6147 11643 y Fh(;)30 b Fs(end)6491 11670 y Fn(2)6569
11643 y Fi(\))p Ft(.)3661 12141 y(54)p eop end
%%Page: 55 63
TeXDict begin 55 62 bop 448 1146 a Ft(The)65 b Fp
(...-delete-neighbor-dups-...)117 b Ft(pr)m(ocedur)m(es:)95
b(These)65 b(pr)m(ocedur)m(es)g(delete)166 1372 y(adjacent)38
b(duplicate)g(elements)h(fr)m(om)e(a)i(list)g(or)f(a)h(vector)-13
b(,)40 b(using)e(a)h(given)f(element-equality)f(pr)m(o-)166
1597 y(cedur)m(e.)57 b(The)46 b(\002rst/leftmost)g(element)f(of)g(a)h
(r)o(un)e(of)i(equal)f(elements)g(is)h(the)g(one)g(that)g(survives.)166
1823 y(The)g(list)f(or)h(vector)f(is)h(not)g(otherwise)f(disor)m(der)m
(ed.)448 2057 y(These)55 b(pr)m(ocedur)m(es)e(ar)m(e)h(linear)f
(time\227much)f(faster)i(than)g(the)g Fh(O)5 b Fi(\()p
Fh(n)5338 1991 y Fn(2)5416 2057 y Fi(\))54 b Ft(general)g(duplicate-)
166 2283 y(element)63 b(deletors)h(that)f(do)g(not)h(assume)e(any)h
(\223bunching\224)f(of)g(elements)h(\(such)f(as)h(the)h(ones)166
2509 y(pr)m(ovided)k(by)f(SRFI)i(1\).)124 b(If)68 b(you)f(want)h(to)g
(delete)h(duplicate)e(elements)h(fr)m(om)f(a)h(lar)m(ge)f(list)h(or)166
2735 y(vector)-13 b(,)53 b(you)e(can)f(sort)i(the)f(elements)g(to)h
(bring)e(equal)h(items)g(together)-13 b(,)53 b(then)e(use)g(one)h(of)f
(these)166 2960 y(pr)m(ocedur)m(es,)45 b(for)g(a)h(total)g(time)f(of)g
Fh(O)5 b Fi(\()p Fh(n)30 b Fi(log)r(\()p Fh(n)p Fi(\)\))p
Ft(.)448 3194 y(The)50 b(comparison)g(pr)m(ocedur)m(e)e
Fi(=)i Ft(passed)h(to)f(these)g(pr)m(ocedur)m(es)f(is)g(always)g
(applied)i Fp(\()p Fi(=)109 b Fh(x)166 3420 y(y)7 b Fp(\))45
b Ft(wher)m(e)g Fh(x)g Ft(comes)g(befor)m(e)g Fh(y)52
b Ft(in)45 b(the)h(containing)f(list)h(or)f(vector)-13
b(.)439 3885 y Fl(\017)91 b Fp(List-delete-neighbor-dups)69
b Ft(does)f(not)g(alter)f(its)h(input)f(list;)79 b(its)68
b(answer)e(may)621 4111 y(shar)m(e)44 b(storage)i(with)g(the)f(input)h
(list.)439 4519 y Fl(\017)91 b Fp(Vector-delete-neighbor-dups)67
b Ft(does)e(not)h(alter)e(its)i(input)e(vector)-13 b(,)70
b(but)64 b(rather)621 4745 y(allocates)45 b(a)g(fr)m(esh)g(vector)g(to)
h(hold)g(the)g(r)m(esult.)166 5210 y(Examples:)497 5683
y Fp(\(list-delete-neighbor-dups)111 b(=)e('\(1)h(1)f(2)g(7)g(7)g(7)h
(0)f(-2)g(-2\)\))715 5917 y Fi(=)-30 b Fl(\))109 b Fp(\(1)g(2)g(7)h(0)f
(-2\))497 6385 y(\(vector-delete-neighbor-dups)i(=)f('#\(1)f(1)g(2)g(7)
h(7)f(7)g(0)g(-2)g(-2\)\))715 6619 y Fi(=)-30 b Fl(\))109
b Fp(#\(1)g(2)h(7)f(0)g(-2\))497 7087 y(\(vector-delete-neighbor-dups)i
(=)f('#\(1)f(1)g(2)g(7)h(7)f(7)g(0)g(-2)g(-2\))h(3)f(7\))715
7321 y Fi(=)-30 b Fl(\))109 b Fp(#\(7)g(0)h(-2\))166
7873 y Fq(Algorithm-speci\002c)43 b(sorting)h(packages)166
8243 y Ft(These)55 b(packages)f(pr)m(ovide)g(mor)m(e)f(speci\002c)h
(sorting)g(functionality)-20 b(,)55 b(that)g(is,)h(speci\002c)e
(committ-)166 8469 y(ment)59 b(to)i(particular)d(algorithms)i(that)g
(have)f(particular)g(pragmatic)g(consequences)g(\(such)f(as)166
8695 y(memory)43 b(locality)-20 b(,)44 b(asymptotic)g(r)o(unning)e
(time\))h(beyond)g(their)h(semantic)f(behaviour)f(\(sorting,)166
8921 y(stable)54 b(sorting,)j(mer)m(ging,)e(etc.\).)83
b(Pr)m(ogrammers)53 b(that)h(need)g(a)g(particular)f(algorithm)h(can)f
(use)166 9146 y(one)46 b(of)f(these)h(packages.)166 9699
y Fe(sorted)p Fq(\227sorted)f(predicates)202 10106 y
Fl(\017)91 b Fp(\(list-sorted?)103 b Fh(<)92 b Fs(list)p
Fp(\))d Fl(!)i Fs(boolean)202 10332 y Fl(\017)g Fp(\(vector-sorted?)103
b Fh(<)92 b Fs(vector)p Fp(\))d Fl(!)i Fs(boolean)202
10558 y Fl(\017)g Fp(\(vector-sorted?)103 b Fh(<)92 b
Fs(vector)d(start)p Fp(\))h Fl(!)g Fs(boolean)202 10784
y Fl(\017)h Fp(\(vector-sorted?)103 b Fh(<)92 b Fs(vector)d(start)g
(end)p Fp(\))i Fl(!)g Fs(boolean)448 11191 y Ft(Return)66
b Fp(#f)g Ft(if)m(f)e(ther)m(e)i(is)g(an)f(adjacent)g(pair)h
Fh(:)30 b(:)g(:)f(x;)h(y)37 b(:)30 b(:)g(:)65 b Ft(in)g(the)h(input)g
(list)f(or)h(vector)g(such)166 11417 y(that)49 b Fh(y)63
b(<)58 b(x)p Ft(.)66 b(The)50 b(optional)f Fs(start)n
Ft(/)p Fs(end)g Ft(range)g(ar)m(guments)e(r)m(estrict)i
Fp(vector-sorted?)68 b Ft(to)49 b(the)166 11643 y(indicated)c
(subvector)-13 b(.)3495 12141 y(55)p eop end
%%Page: 56 64
TeXDict begin 56 63 bop 332 1146 a Fe(list-merge-sort)p
Fq(\227list)45 b(merge)g(sort)368 1523 y Fl(\017)91 b
Fp(\(list-merge-sort)i Fh(<)e Fs(list)p Fp(\))e Fl(!)i
Fs(list)368 1749 y Fl(\017)g Fp(\(list-merge-sort!)104
b Fh(<)91 b Fs(list)p Fp(\))e Fl(!)i Fs(list)368 1975
y Fl(\017)g Fp(\(list-merge)h Fs(list)2075 2002 y Fn(1)2243
1975 y Fh(<)g Fs(list)2710 2002 y Fn(2)2787 1975 y Fp(\))f
Fl(!)g Fs(list)368 2200 y Fl(\017)g Fp(\(list-merge!)103
b Fs(list)2195 2227 y Fn(1)2363 2200 y Fh(<)92 b Fs(list)2830
2227 y Fn(2)2907 2200 y Fp(\))f Fl(!)g Fs(list)332 2578
y Ft(The)47 b(sort)h(pr)m(ocedur)m(es)e(sort)i(their)e(data)i(using)e
(a)h(list)g(mer)m(ge)g(sort,)h(which)e(is)h(stable.)61
b(\(The)47 b(r)m(efer)m(-)332 2803 y(ence)g(implementation)g(is,)h
(additionally)-20 b(,)48 b(a)f(\223natural\224)f(sort.)62
b(See)48 b(below)e(for)h(the)h(pr)m(operties)f(of)332
3029 y(this)f(algorithm.\))614 3256 y(The)57 b Fp(!)88
b Ft(pr)m(ocedur)m(es)55 b(ar)m(e)g(destr)o(uctive\227they)h(use)f
Fp(set-cdr!)p Ft(s)i(to)g(r)m(earrange)e(the)h(cells)f(of)332
3481 y(the)43 b(lists)g(into)g(the)g(pr)m(oper)g(or)m(der)-13
b(.)56 b(As)43 b(such,)g(they)g(do)g(not)g(allocate)g(any)g(extra)g
(cons)f(cells\227they)332 3707 y(ar)m(e)j(\223in)g(place\224)g(sorts.)
614 3934 y(The)67 b(mer)m(ge)e(operations)i(ar)m(e)e(stable:)98
b(an)65 b(element)h(of)g Fs(list)4825 3961 y Fn(1)4968
3934 y Ft(will)f(come)h(befor)m(e)f(an)g(equal-)332 4159
y(comparing)45 b(element)g(in)g Fs(list)2373 4186 y Fn(2)2496
4159 y Ft(in)g(the)h(r)m(esult)f(list.)332 4665 y Fe(vector-merge-sort)
p Fq(\227vector)h(merge)f(sort)368 5043 y Fl(\017)91
b Fp(\(vector-merge-sort)i Fh(<)e Fs(vector)f([start)e([end)j([temp]]])
p Fp(\))d Fl(!)j Fs(vector)368 5268 y Fl(\017)g Fp
(\(vector-merge-sort!)i Fh(<)e Fs(vector)f([start)e([end)j([temp]]])p
Fp(\))368 5494 y Fl(\017)g Fp(\(vector-merge)h Fh(<)g
Fs(vector)2741 5521 y Fn(1)2909 5494 y Fs(vector)3358
5521 y Fn(2)3527 5494 y Fs([start)3933 5521 y Fn(1)4100
5494 y Fs([end)4424 5521 y Fn(1)4593 5494 y Fs([start)4999
5521 y Fn(2)5167 5494 y Fs([end)5491 5521 y Fn(2)5569
5494 y Fs(]]]])p Fp(\))d Fl(!)i Fs(vector)368 5720 y
Fl(\017)g Fp(\(vector-merge!)h Fh(<)g Fs(vector)d(vector)3388
5747 y Fn(1)3557 5720 y Fs(vector)4006 5747 y Fn(2)4174
5720 y Fs([start)g([start)5075 5747 y Fn(1)5242 5720
y Fs([end)5566 5747 y Fn(1)5735 5720 y Fs([start)6141
5747 y Fn(2)6309 5720 y Fs([end)6633 5747 y Fn(2)6711
5720 y Fs(]]]]])p Fp(\))332 6097 y Ft(The)50 b(sort)f(pr)m(ocedur)m(es)
g(sort)g(their)g(data)g(using)g(vector)g(mer)m(ge)g(sort,)i(which)d(is)
h(stable.)67 b(\(The)49 b(r)m(ef-)332 6323 y(er)m(ence)h
(implementation)h(is,)i(additionally)-20 b(,)52 b(a)f(\223natural\224)f
(sort.)74 b(See)51 b(below)g(for)f(the)h(pr)m(operties)332
6549 y(of)45 b(this)h(algorithm.\))614 6775 y(The)h(optional)h
Fs(start)n Ft(/)p Fs(end)f Ft(ar)m(guments)e(pr)m(ovide)i(for)f
(sorting)h(of)f(subranges,)h(and)f(default)h(to)332 7001
y(0)e(and)h(the)f(length)h(of)f(the)h(corr)m(esponding)f(vector)-13
b(.)614 7227 y(Mer)m(ge-sorting)48 b(a)g(vector)g(r)m(equir)m(es)e(the)
j(allocation)e(of)h(a)g(temporary)g(\223scratch\224)f(work)h(vec-)332
7453 y(tor)42 b(for)f(the)g(duration)g(of)g(the)h(sort.)55
b(This)42 b(scratch)f(vector)g(can)g(be)f(passed)i(in)f(by)g(the)h
(client)f(as)g(the)332 7679 y(optional)49 b Fs(temp)f
Ft(ar)m(gument;)i(if)e(so,)i(the)e(supplied)h(vector)g(must)f(be)g(of)g
(size)h Fl(\024)56 b Fs(end)p Ft(,)50 b(and)e(will)g(not)332
7905 y(be)g(alter)m(ed)h(outside)g(the)f(range)h([start,end\).)66
b(If)48 b(not)h(supplied,)h(the)f(sort)g(r)m(outines)f(allocate)h(one)
332 8131 y(themselves.)614 8357 y(The)i(mer)m(ge)f(operations)h(ar)m(e)
f(stable:)67 b(an)51 b(element)f(of)g Fs(vector)4901
8384 y Fn(1)5029 8357 y Ft(will)g(come)g(befor)m(e)g(an)g(equal-)332
8583 y(comparing)45 b(element)g(in)g Fs(vector)2588 8610
y Fn(2)2711 8583 y Ft(in)g(the)h(r)m(esult)f(vector)-13
b(.)605 9010 y Fl(\017)91 b Fp(Vector-merge-sort!)58
b Ft(leaves)45 b(its)h(r)m(esult)f(in)g Fs(vector)n Fi([)p
Fs(start)n Fh(;)30 b Fs(end)p Fi(\))p Ft(.)605 9387 y
Fl(\017)91 b Fp(Vector-merge-sort)47 b Ft(r)m(eturns)d(a)i(vector)f(of)
g(length)h Fs(end)40 b Fl(\000)h Fs(start)n Ft(.)605
9765 y Fl(\017)91 b Fp(Vector-merge)46 b Ft(r)m(eturns)f(a)g(vector)h
(of)f(length)g Fi(\()p Fs(end)4545 9792 y Fn(1)4664 9765
y Fl(\000)c Fs(start)5191 9792 y Fn(1)5268 9765 y Fi(\))f(+)h(\()p
Fs(end)5895 9792 y Fn(2)6014 9765 y Fl(\000)f Fs(start)6540
9792 y Fn(2)6618 9765 y Fi(\))p Ft(.)605 10142 y Fl(\017)91
b Fp(Vector-merge!)54 b Ft(writes)35 b(its)h(r)m(esult)f(into)g
Fs(vector)o Ft(,)j(beginning)c(at)i(index)f Fs(start)o
Ft(,)i(for)e(indices)787 10368 y(less)45 b(than)h Fs(end)k
Fi(=)h Fs(start)38 b Fi(+)j(\()p Fs(end)2938 10395 y
Fn(1)3057 10368 y Fl(\000)g Fs(start)3584 10395 y Fn(1)3661
10368 y Fi(\))f(+)h(\()p Fs(end)4288 10395 y Fn(2)4406
10368 y Fl(\000)g Fs(start)4933 10395 y Fn(2)5010 10368
y Fi(\))p Ft(.)57 b(The)46 b(tar)m(get)f(subvector)3352
10778 y Fs(vector)n Fi([)p Fs(start)n Fh(;)30 b Fs(end)o
Fi(\))787 11188 y Ft(may)45 b(not)g(overlap)h(either)f(sour)m(ce)g
(subvector)2290 11598 y Fs(vector)2739 11625 y Fn(1)2817
11598 y Fi([)p Fs(start)3213 11625 y Fn(1)3290 11598
y Fh(;)30 b Fs(end)3634 11625 y Fn(1)3712 11598 y Fi(\))p
Fh(;)75 b Ft(or)46 b Fs(vector)4575 11625 y Fn(2)4652
11598 y Fi([)p Fs(start)5048 11625 y Fn(2)5125 11598
y Fh(;)30 b Fs(end)5469 11625 y Fn(2)5547 11598 y Fi(\))p
Fh(:)3661 12141 y Ft(56)p eop end
%%Page: 57 65
TeXDict begin 57 64 bop 166 1146 a Fe(vector-heap-sort)p
Fq(\227vector)46 b(heap)f(sort)202 1534 y Fl(\017)91
b Fp(\(vector-heap-sort)i Fh(<)e Fs(vector)f([start)e([end]])p
Fp(\))i Fl(!)g Fs(vector)202 1759 y Fl(\017)h Fp(\(vector-heap-sort!)i
Fh(<)e Fs(vector)f([start)e([end]])p Fp(\))166 2147 y
Ft(These)59 b(pr)m(ocedur)m(es)f(sort)h(their)f(data)h(using)f(heap)h
(sort,)j(which)c(is)g(not)h(a)f(stable)h(sorting)f(algo-)166
2373 y(rithm.)448 2602 y Fp(Vector-heap-sort)41 b Ft(r)m(eturns)d(a)h
(vector)g(of)g(length)g Fs(end)16 b Fl(\000)h Fs(start)o
Ft(.)54 b Fp(Vector-heap-sort!)166 2828 y Ft(is)45 b(in-place,)h
(leaving)e(its)i(r)m(esult)f(in)g Fs(vector)o Fi([)p
Fs(start)n Fh(;)30 b Fs(end)o Fi(\))p Ft(.)166 3350 y
Fe(vector-insert-sort)p Fq(\227vector)46 b(insertion)e(sort)202
3738 y Fl(\017)91 b Fp(\(vector-insert-sort)i Fh(<)e
Fs(vector)f([start)e([end]])p Fp(\))i Fl(!)h Fs(vector)202
3964 y Fl(\017)g Fp(\(vector-insert-sort!)i Fh(<)e Fs(vector)f([start)f
([end]])p Fp(\))166 4352 y Ft(These)46 b(pr)m(ocedur)m(es)f(stably)g
(sort)h(their)f(data)h(using)f(insertion)g(sort.)439
4740 y Fl(\017)91 b Fp(Vector-insert-sort)47 b Ft(r)m(eturns)d(a)i
(vector)f(of)g(length)h Fs(end)40 b Fl(\000)h Fs(start)n
Ft(.)439 5128 y Fl(\017)91 b Fp(Vector-insert-sort!)58
b Ft(is)45 b(in-place,)g(leaving)g(its)h(r)m(esult)f(in)g
Fs(vector)o Fi([)p Fs(start)m Fh(;)30 b Fs(end)p Fi(\))p
Ft(.)166 5650 y Fe(delete-neighbor-duplicates)p Fq(\227list)46
b(and)g(vector)e(delete)g(neighbor)i(duplicates)202 6038
y Fl(\017)91 b Fp(\(list-delete-neighbor-dups)i Fi(=)f
Fs(list)p Fp(\))d Fl(!)i Fs(list)202 6264 y Fl(\017)g
Fp(\(list-delete-neighbor-dups!)104 b Fi(=)92 b Fs(list)p
Fp(\))d Fl(!)i Fs(list)202 6490 y Fl(\017)g Fp
(\(vector-delete-neighbor-dups)j Fi(=)d Fs(vector)f([start)e([end]])p
Fp(\))i Fl(!)g Fs(vector)202 6716 y Fl(\017)h Fp
(\(vector-delete-neighbor-dups!)105 b Fi(=)91 b Fs(vector)f([start)e
([end]])p Fp(\))i Fl(!)g Fs(end)6095 6650 y Fj(0)166
7104 y Ft(These)61 b(pr)m(ocedur)m(es)g(delete)g(adjacent)f(duplicate)h
(elements)g(fr)m(om)f(a)g(list)h(or)g(a)g(vector)-13
b(,)65 b(using)60 b(a)166 7330 y(given)72 b(element-equality)f(pr)m
(ocedur)m(e)h Fi(=)p Ft(.)137 b(The)73 b(\002rst/leftmost)f(element)g
(of)g(a)h(r)o(un)e(of)h(equal)166 7555 y(elements)45
b(is)h(the)f(one)h(that)g(survives.)56 b(The)46 b(list)f(or)h(vector)f
(is)h(not)f(otherwise)h(disor)m(der)m(ed.)448 7784 y(These)55
b(pr)m(ocedur)m(es)e(ar)m(e)h(linear)f(time\227much)f(faster)i(than)g
(the)g Fh(O)5 b Fi(\()p Fh(n)5338 7718 y Fn(2)5416 7784
y Fi(\))54 b Ft(general)g(duplicate-)166 8010 y(element)63
b(deletors)h(that)f(do)g(not)h(assume)e(any)h(\223bunching\224)f(of)g
(elements)h(\(such)f(as)h(the)h(ones)166 8236 y(pr)m(ovided)k(by)f
(SRFI)i(1\).)124 b(If)68 b(you)f(want)h(to)g(delete)h(duplicate)e
(elements)h(fr)m(om)f(a)h(lar)m(ge)f(list)h(or)166 8462
y(vector)-13 b(,)53 b(you)e(can)f(sort)i(the)f(elements)g(to)h(bring)e
(equal)h(items)g(together)-13 b(,)53 b(then)e(use)g(one)h(of)f(these)
166 8688 y(pr)m(ocedur)m(es,)45 b(for)g(a)h(total)g(time)f(of)g
Fh(O)5 b Fi(\()p Fh(n)30 b Fi(log)r(\()p Fh(n)p Fi(\)\))p
Ft(.)448 8917 y(The)46 b(comparison)f(pr)m(ocedur)m(e)g(=)h(passed)g
(to)g(these)f(pr)m(ocedur)m(es)g(is)h(always)f(applied)497
9361 y Fp(\()p Fi(=)109 b Fh(x)g(y)7 b Fp(\))448 9802
y Ft(wher)m(e)45 b Fh(x)g Ft(comes)g(befor)m(e)g Fh(y)52
b Ft(in)45 b(the)h(containing)f(list)h(or)f(vector)-13
b(.)439 10190 y Fl(\017)91 b Fp(List-delete-neighbor-dups)69
b Ft(does)f(not)g(alter)f(its)h(input)f(list;)79 b(its)68
b(answer)e(may)621 10416 y(shar)m(e)44 b(storage)i(with)g(the)f(input)h
(list.)439 10803 y Fl(\017)91 b Fp(Vector-delete-neighbor-dups)67
b Ft(does)e(not)h(alter)e(its)i(input)e(vector)-13 b(,)70
b(but)64 b(rather)621 11029 y(allocates)45 b(a)g(fr)m(esh)g(vector)g
(to)h(hold)g(the)g(r)m(esult.)439 11417 y Fl(\017)91
b Fp(List-delete-neighbor-dups!)64 b Ft(is)47 b(permitted,)i(but)e(not)
h(r)m(equir)m(ed,)f(to)h(mutate)f(its)621 11643 y(input)e(list)h(in)f
(or)m(der)g(to)h(constr)o(uct)f(its)g(answer)-13 b(.)3495
12141 y(57)p eop end
%%Page: 58 66
TeXDict begin 58 65 bop 605 1146 a Fl(\017)91 b Fp
(Vector-delete-neighbor-dups!)144 b Ft(r)m(euses)74 b(its)g(input)g
(vector)g(to)h(hold)f(the)g(an-)787 1372 y(swer)-13 b(,)47
b(packing)f(its)h(answer)g(into)g(the)g(index)f(range)h
Fi([)p Fs(start)n Fh(;)30 b Fs(end)5212 1306 y Fj(0)5258
1372 y Fi(\))p Ft(,)47 b(wher)m(e)f Fs(end)6231 1306
y Fj(0)6325 1372 y Ft(is)h(the)g(non-)787 1597 y(negative)68
b(exact)g(integer)h(r)m(eturned)f(as)g(its)h(value.)125
b(It)69 b(r)m(eturns)f Fs(end)5633 1531 y Fj(0)5748 1597
y Ft(as)g(its)h(r)m(esult.)126 b(The)787 1823 y(vector)45
b(is)g(not)h(alter)m(ed)g(outside)f(the)h(range)f Fi([)p
Fs(start)n Fh(;)30 b Fs(end)4600 1757 y Fj(0)4646 1823
y Fi(\))p Ft(.)332 2198 y(Examples:)663 2622 y Fp
(\(list-delete-neighbor-dups)111 b(=)e('\(1)h(1)f(2)g(7)g(7)h(7)f(0)g
(-2)g(-2\)\))881 2848 y Fi(=)-30 b Fl(\))109 b Fp(\(1)g(2)g(7)h(0)f
(-2\))663 3300 y(\(vector-delete-neighbor-dups)i(=)f('#\(1)f(1)g(2)g(7)
h(7)f(7)g(0)g(-2)g(-2\)\))881 3526 y Fi(=)-30 b Fl(\))109
b Fp(#\(1)g(2)h(7)f(0)g(-2\))663 3977 y(\(vector-delete-neighbor-dups)i
(=)f('#\(1)f(1)g(2)g(7)h(7)f(7)g(0)g(-2)g(-2\))h(3)f(7\))881
4203 y Fi(=)-30 b Fl(\))109 b Fp(#\(7)g(0)h(-2\))663
4655 y(;;)f(Result)h(left)f(in)g(v[3,9\):)663 4881 y(\(let)g(\(\(v)h
(\(vector)f(0)h(0)f(0)g(1)g(1)g(2)g(2)h(3)f(3)g(4)g(4)g(5)h(5)f(6)g
(6\)\)\))881 5107 y(\(cons)h(\(vector-delete-neighbor-dups!)h(=)e(v)h
(3\))1536 5332 y(v\)\))990 5558 y Fi(=)-30 b Fl(\))109
b Fp(\(9)g(.)h(#\(0)f(0)g(0)g(1)g(2)h(3)f(4)g(5)g(6)g(4)h(4)f(5)g(5)g
(6)g(6\)\))332 6061 y Fe(binary-searches)p Fq(\227vector)46
b(binary)f(search)368 6436 y Fl(\017)91 b Fp(\(vector-binary-search)i
Fh(<)e Fs(elt-)p Fh(>)p Fs(key)e(key)i(vector)e([start)g([end]])p
Fp(\))g Fl(!)i Fs(integer)e(or)i Fp(#f)368 6662 y Fl(\017)g
Fp(\(vector-binary-search3)i Fs(compar)m(e-pr)m(oc)c(vector)g([start)g
([end]])p Fp(\))g Fl(!)i Fs(integer)e(or)i Fp(#f)614
7036 y(vector-binary-search)52 b Ft(sear)m(ches)e Fs(vector)f
Ft(in)h(range)g Fi([)p Fs(start)n Fh(;)30 b Fs(end)o
Fi(\))50 b Ft(\(which)f(default)g(to)i(0)332 7262 y(and)62
b(the)g(length)g(of)g Fs(vector)o Ft(,)67 b(r)m(espectively\))61
b(for)h(an)g(element)g(whose)g(associated)g(key)h(is)f(equal)332
7488 y(to)f Fs(key)o Ft(.)100 b(The)60 b(pr)m(ocedur)m(e)f
Fs(elt-)p Fh(>)p Fs(key)g Ft(is)g(used)h(to)h(map)e(an)h(element)g(to)g
(its)g(associated)g(key)-20 b(.)101 b(The)332 7714 y(elements)40
b(of)g(the)h(vector)f(ar)m(e)g(assumed)f(to)i(be)f(or)m(der)m(ed)g(by)g
(the)h Fh(<)f Ft(r)m(elation)g(on)h(these)f(keys.)56
b(That)332 7940 y(is,)663 8364 y Fp(\(vector-sorted?)110
b(\(lambda)g(\(x)f(y\))h(\()p Fh(<)f Fp(\()p Fs(elt-\243\277\243key)e
Fp(x\))i(\()p Fs(elt-\243\277\243key)e Fp(y\)\)\))2408
8590 y Fs(vector)h(start)f(end)p Fp(\))i Fi(=)-30 b Fl(\))109
b Fp(true)614 9015 y Ft(An)45 b(element)e Fs(e)h Ft(of)g
Fs(vector)f Ft(is)g(a)h(match)g(for)f Fs(key)h Ft(if)f(it's)h(neither)g
(less)g(nor)g(gr)m(eater)f(than)h(the)g(key:)663 9439
y Fp(\(and)109 b(\(not)h(\()p Fh(<)f Fp(\()p Fs(elt-\243\277\243key)e
(e)p Fp(\))i Fs(key)o Fp(\)\))1208 9665 y(\(not)h(\()p
Fh(<)f Fs(key)g Fp(\()p Fs(elt-\243\277\243key)d(e)p
Fp(\)\)\)\))614 10089 y Ft(If)41 b(ther)m(e)h(is)f(such)g(an)g
(element,)h(the)f(pr)m(ocedur)m(e)g(r)m(eturns)g(its)g(index)g(in)g
(the)h(vector)f(as)g(an)g(exact)332 10315 y(integer)-13
b(.)57 b(If)45 b(ther)m(e)g(is)h(no)f(such)g(element)g(in)g(the)h(sear)
m(ched)f(range,)g(the)h(pr)m(ocedur)m(e)f(r)m(eturns)f(false.)663
10740 y Fp(\(vector-binary-search)111 b(<)e(car)g(4)h('#\(\(1)f(.)g
(one\))h(\(3)f(.)g(three\))4263 10966 y(\(4)g(.)g(four\))h(\(25)f(.)663
11191 y(twenty-five\)\)\))663 11417 y Fi(=)-30 b Fl(\))109
b Fp(2)3661 12141 y Ft(58)p eop end
%%Page: 59 67
TeXDict begin 59 66 bop 497 1146 a Fp(\(vector-binary-search)111
b(<)e(car)g(7)g('#\(\(1)h(.)f(one\))h(\(3)f(.)g(three\))4097
1377 y(\(4)g(.)g(four\))h(\(25)f(.)497 1603 y(twenty-five\)\)\))497
1835 y Fi(=)-30 b Fl(\))109 b Fp(#f)448 2290 y(Vector-binary-search3)52
b Ft(is)e(a)g(variant)f(that)h(uses)g(a)g(thr)m(ee-way)f(comparison)h
(pr)m(oce-)166 2516 y(dur)m(e)44 b Fs(compar)m(e-pr)m(oc)m
Ft(.)57 b Fs(Compar)m(e-pr)m(oc)42 b Ft(compar)m(es)h(its)i(parameter)f
(to)g(the)h(sear)m(ch)e(key)-20 b(,)45 b(and)f(r)m(eturns)166
2742 y(an)h(exact)g(integer)h(whose)f(sign)h(indicates)f(its)h(r)m
(elationship)f(to)h(the)g(sear)m(ch)e(key)-20 b(.)1744
3168 y Fi(\()p Fs(compar)m(e-pr)m(oc)43 b Fh(x)p Fi(\))166
b Fh(<)g Fi(0)g Fl(\))g Fh(x)g(<)g Fs(sear)m(ch-key)1744
3394 y Fi(\()p Fs(compar)m(e-pr)m(oc)43 b Fh(x)p Fi(\))166
b(=)g(0)g Fl(\))g Fh(x)g Fi(=)g Fs(sear)m(ch-key)1744
3620 y Fi(\()p Fs(compar)m(e-pr)m(oc)43 b Fh(x)p Fi(\))166
b Fh(>)g Fi(0)g Fl(\))g Fh(x)g(>)g Fs(sear)m(ch-key)497
4060 y Fp(\(vector-binary-search3)111 b(\(lambda)f(\(elt\))f(\(-)g
(\(car)h(elt\))f(4\)\))3006 4292 y('#\(\(1)g(.)h(one\))f(\(3)g(.)g
(three\))3333 4523 y(\(4)g(.)h(four\))f(\(25)g(.)h(twenty-five\)\)\))
497 4755 y Fi(=)-30 b Fl(\))109 b Fp(2)166 5301 y Fg(5.19.3)197
b(Algorithmic)51 b(properties)166 5667 y Ft(Dif)m(fer)m(ent)f(sort)i
(and)g(mer)m(ge)f(algorithms)h(have)f(dif)m(fer)m(ent)g(pr)m(operties.)
76 b(Choose)52 b(the)h(algorithm)166 5893 y(that)46 b(matches)f(your)g
(needs:)166 6348 y Fq(V)-20 b(ector)45 b(insert)f(sort)90
b Ft(Stable,)46 b(but)f(only)g(suitable)g(for)g(small)g(vectors\227)p
Fh(O)5 b Fi(\()p Fh(n)5474 6282 y Fn(2)5552 6348 y Fi(\))p
Ft(.)166 6747 y Fq(V)-20 b(ector)45 b(heap)g(sort)90
b Ft(Not)60 b(stable.)99 b(Guaranteed)59 b(fast\227)p
Fh(O)5 b Fi(\()p Fh(n)30 b Fi(log)r(\()p Fh(n)p Fi(\)\))59
b Fs(worst)f Ft(case.)99 b(Poor)60 b(locality)621 6973
y(on)45 b(lar)m(ge)g(vectors.)57 b(A)46 b(very)f(r)m(eliable)f
(workhorse.)166 7372 y Fq(V)-20 b(ector)45 b(merge)f(sort)90
b Ft(Stable.)126 b(Not)69 b(in-place\227r)m(equir)m(es)d(a)j(temporary)
f(buf)m(fer)f(of)h(equal)g(size.)621 7598 y(Fast\227)p
Fh(O)5 b Fi(\()p Fh(n)30 b Fi(log)q(\()p Fh(n)p Fi(\)\))p
Ft(\227and)45 b(has)g(good)h(memory)f(locality)h(for)f(lar)m(ge)g
(vectors.)621 7910 y(The)63 b(implementation)f(of)h(vector)f(mer)m(ge)g
(sort)h(pr)m(ovided)g(by)f(this)h(implementation)g(is,)621
8136 y(additionally)-20 b(,)42 b(a)f(\223natural\224)f(sort,)i(meaning)
f(that)g(it)g(exploits)h(existing)f(or)m(der)f(in)h(the)g(input)621
8362 y(data,)46 b(pr)m(oviding)f Fh(O)5 b Fi(\()p Fh(n)p
Fi(\))44 b Ft(best)i(case.)166 8761 y Fq(Destructive)e(list)g(merge)g
(sort)90 b Ft(Stable,)45 b(fast)f(and)g(in-place)g(\(i.e.,)h(allocates)
f(no)h(new)e(cons)h(cells\).)621 8987 y(\223Fast\224)59
b(means)h Fh(O)5 b Fi(\()p Fh(n)30 b Fi(log)q(\()p Fh(n)p
Fi(\)\))59 b Ft(worse-case,)k(and)d(substantially)f(better)g(if)g(the)h
(data)g(is)g(al-)621 9213 y(r)m(eady)45 b(mostly)i(or)m(der)m(ed,)f
(all)g(the)g(way)f(down)h(to)h(linear)e(time)h(for)g(a)g(completely-or)
m(der)m(ed)621 9439 y(input)f(list)h(\(i.e.,)g(it)g(is)f(a)g
(\223natural\224)g(sort\).)621 9751 y(Note)i(that)g(sorting)g(lists)f
(involves)g(chasing)g(pointers)h(thr)m(ough)f(memory)-20
b(,)47 b(which)e(can)h(be)621 9977 y(a)35 b(loser)h(on)f(modern)g
(machine)f(ar)m(chitectur)m(es)g(because)h(of)g(poor)h(cache)f(and)g
(page)h(locality)-20 b(.)621 10203 y(Sorting)46 b(vectors)f(has)g
(inher)m(ently)g(better)h(locality)-20 b(.)621 10515
y(This)63 b(implementation's)f(destr)o(uctive)g(list)h(mer)m(ge)f(and)h
(mer)m(ge)f(sort)h(implementations)621 10741 y(ar)m(e)89
b(opportunistic\227they)h(avoid)g(r)m(edundant)f Fp(set-cdr!)p
Ft(s,)103 b(and)89 b(try)h(to)h(take)f(long)621 10967
y(alr)m(eady-or)m(der)m(ed)44 b(r)o(uns)g(of)h(list)h(str)o(uctur)m(e)e
(as-is)h(when)g(doing)h(the)f(mer)m(ges.)166 11366 y
Fq(Pure)g(list)f(merge)h(sort)90 b Ft(Stable)55 b(and)f(fast\227)p
Fh(O)5 b Fi(\()p Fh(n)30 b Fi(log)r(\()p Fh(n)p Fi(\)\))53
b Ft(worst-case,)k(and)e(possibly)g Fh(O)5 b Fi(\()p
Fh(n)p Fi(\))p Ft(,)56 b(de-)621 11592 y(pending)45 b(upon)h(the)f
(input)h(list)f(\(see)g(discussion)h(above\).)3495 12141
y(59)p eop end
%%Page: 60 68
TeXDict begin 60 67 bop 1238 1121 a Ft(Algorithm)413
b(Stable?)199 b(W)-17 b(orst)46 b(case)256 b(A)-17 b(verage)46
b(case)199 b(In-place)p 1138 1196 5228 7 v 1238 1354
a(V)-20 b(ector)46 b(insert)249 b(Y)-17 b(es)498 b Fh(O)5
b Fi(\()p Fh(n)3586 1288 y Fn(2)3665 1354 y Fi(\))636
b Fh(O)5 b Fi(\()p Fh(n)4696 1288 y Fn(2)4774 1354 y
Fi(\))773 b Ft(Y)-17 b(es)1238 1579 y(V)d(ector)46 b(quick)256
b(No)516 b Fh(O)5 b Fi(\()p Fh(n)3586 1513 y Fn(2)3665
1579 y Fi(\))636 b Fh(O)5 b Fi(\()p Fh(n)30 b Fi(log)q(\()p
Fh(n)p Fi(\)\))336 b Ft(Y)-17 b(es)1238 1805 y(V)d(ector)46
b(heap)310 b(No)516 b Fh(O)5 b Fi(\()p Fh(n)30 b Fi(log)r(\()p
Fh(n)p Fi(\)\))199 b Fh(O)5 b Fi(\()p Fh(n)30 b Fi(log)q(\()p
Fh(n)p Fi(\)\))336 b Ft(Y)-17 b(es)1238 2031 y(V)d(ector)46
b(mer)m(ge)198 b(Y)-17 b(es)498 b Fh(O)5 b Fi(\()p Fh(n)30
b Fi(log)r(\()p Fh(n)p Fi(\)\))199 b Fh(O)5 b Fi(\()p
Fh(n)30 b Fi(log)q(\()p Fh(n)p Fi(\)\))336 b Ft(No)1238
2257 y(List)46 b(mer)m(ge)407 b(Y)-17 b(es)498 b Fh(O)5
b Fi(\()p Fh(n)30 b Fi(log)r(\()p Fh(n)p Fi(\)\))199
b Fh(O)5 b Fi(\()p Fh(n)30 b Fi(log)q(\()p Fh(n)p Fi(\)\))336
b Ft(Either)332 2811 y Fm(5.20)238 b(Regular)58 b(expressions)332
3233 y Ft(This)84 b(section)g(describes)f(a)h(functional)e(interface)h
(for)g(building)g(r)m(egular)g(expr)m(essions)g(and)332
3459 y(matching)66 b(them)g(against)h(strings.)121 b(The)67
b(matching)f(is)g(done)h(using)g(the)f(POSIX)i(r)m(egular)e(ex-)332
3685 y(pr)m(ession)46 b(package.)57 b(Regular)45 b(expr)m(essions)g(ar)
m(e)g(in)h(the)f(str)o(uctur)m(e)f Fp(regexps)p Ft(.)614
3911 y(A)53 b(r)m(egular)e(expr)m(ession)h(is)g(either)g(a)g(character)
f(set,)j(which)d(matches)g(any)h(character)f(in)h(the)332
4137 y(set,)k(or)c(a)h(composite)g(expr)m(ession)g(containing)f(one)h
(or)g(mor)m(e)f(subexpr)m(essions.)78 b(A)53 b(r)m(egular)f(ex-)332
4363 y(pr)m(ession)44 b(can)g(be)f(matched)h(against)f(a)h(string)g(to)
h(determine)e(success)h(or)g(failur)m(e,)f(and)h(to)g(deter)m(-)332
4588 y(mine)h(the)h(substrings)e(matched)h(by)g(particular)g(subexpr)m
(essions.)332 5098 y Fg(5.20.1)197 b(Character)49 b(sets)332
5452 y Ft(Character)i(sets)i(may)e(be)h(de\002ned)g(using)f(a)h(list)g
(of)g(characters)f(and)h(strings,)i(using)d(a)h(range)g(or)332
5677 y(ranges)45 b(of)h(characters,)f(or)g(by)g(using)g(set)h
(operations)g(on)g(existing)f(character)g(sets.)368 6020
y Fl(\017)91 b Fp(\(set)h Fs(character-or-string)86 b(.)27
b(.)g(.)g Fp(\))104 b Fl(!)90 b Fs(char-set)368 6245
y Fl(\017)h Fp(\(range)h Fs(low-char)d(high-char)p Fp(\))g
Fl(!)i Fs(char-set)368 6471 y Fl(\017)g Fp(\(ranges)h
Fs(low-char)d(high-char)g(.)27 b(.)g(.)g Fp(\))104 b
Fl(!)91 b Fs(char-set)368 6697 y Fl(\017)g Fp(\(ascii-range)h
Fs(low-char)e(high-char)p Fp(\))f Fl(!)i Fs(char-set)368
6923 y Fl(\017)g Fp(\(ascii-ranges)h Fs(low-char)e(high-char)f(.)27
b(.)g(.)g Fp(\))104 b Fl(!)91 b Fs(char-set)332 7265
y Fp(Set)73 b Ft(r)m(eturns)f(a)h(set)h(that)f(contains)g(the)g
(character)f(ar)m(guments)g(and)g(the)i(characters)e(in)g(any)332
7491 y(string)59 b(ar)m(guments.)97 b Fp(Range)59 b Ft(r)m(eturns)f(a)h
(character)f(set)i(that)f(contain)g(all)f(characters)h(between)332
7716 y Fs(low-char)52 b Ft(and)i Fs(high-char)p Ft(,)g(inclusive.)80
b Fp(Ranges)54 b Ft(r)m(eturns)f(a)h(set)g(that)g(contains)f(all)h
(characters)e(in)332 7942 y(the)45 b(given)f(ranges.)57
b Fp(Range)45 b Ft(and)g Fp(ranges)g Ft(use)g(the)g(or)m(dering)f
(induced)g(by)g Fp(char->integer)p Ft(.)332 8168 y Fp(Ascii-range)54
b Ft(and)f Fp(ascii-ranges)h Ft(use)e(the)h(ASCII)i(or)m(dering.)79
b(It)53 b(is)g(an)f(err)m(or)h(for)f(a)h Fs(high-)332
8394 y(char)45 b Ft(to)h(be)f(less)h(than)f(the)h(pr)m(eceding)f
Fs(low-char)e Ft(in)j(the)f(appr)m(opriate)h(or)m(dering.)368
8736 y Fl(\017)91 b Fp(\(negate)h Fs(char-set)p Fp(\))d
Fl(!)h Fs(char-set)368 8962 y Fl(\017)h Fp(\(intersection)h
Fs(char-set)d(char-set)p Fp(\))g Fl(!)i Fs(char-set)368
9188 y Fl(\017)g Fp(\(union)h Fs(char-set)d(char-set)p
Fp(\))f Fl(!)j Fs(char-set)368 9413 y Fl(\017)g Fp(\(subtract)h
Fs(char-set)d(char-set)p Fp(\))g Fl(!)h Fs(char-set)332
9756 y Ft(These)46 b(perform)f(the)h(indicated)f(operations)h(on)f
(character)g(sets.)614 9981 y(The)h(following)f(character)g(sets)h(ar)m
(e)f(pr)m(ede\002ned:)707 10539 y Fp(lower-case)418 b(\(set)110
b("abcdefghijklmnopqrstuvwxyz"\))707 10765 y(upper-case)418
b(\(set)110 b("ABCDEFGHIJKLMNOPQRSTUVWXYZ"\))707 10991
y(alphabetic)418 b(\(union)110 b(lower-case)g(upper-case\))707
11217 y(numeric)745 b(\(set)110 b("0123456789"\))707
11443 y(alphanumeric)200 b(\(union)110 b(alphabetic)g(numeric\))707
11668 y(punctuation)309 b(\(set)110 b
("!\\"#$\045&'\(\)*+,-./:;<=>?@[\\\\]\210_`{|}\230"\))3661
12141 y Ft(60)p eop end
%%Page: 61 69
TeXDict begin 61 68 bop 541 1146 a Fp(graphic)745 b(\(union)110
b(alphanumeric)g(punctuation\))541 1372 y(printing)636
b(\(union)110 b(graphic)g(\(set)f(#\\space\)\))541 1597
y(control)745 b(\(negate)110 b(printing\))541 1823 y(blank)963
b(\(set)110 b(#\\space)f(\(ascii->char)i(9\)\))45 b Ft(;)h(9)g(is)f
(tab)541 2049 y Fp(whitespace)418 b(\(union)110 b(\(set)f(#\\space\))h
(\(ascii-range)g(9)g(13\)\))541 2275 y(hexdigit)636 b(\(set)110
b("0123456789abcdefABCDEF"\))166 3340 y Ft(The)45 b(above)g(ar)m(e)f
(taken)h(fr)m(om)f(the)h(default)f(locale)h(in)f(POSIX.)i(The)g
(characters)e(in)g Fp(whitespace)166 3565 y Ft(ar)m(e)h
Fs(space)p Ft(,)g Fs(tab)p Ft(,)g Fs(newline)g Ft(\(=)g
Fs(line)f(feed)p Ft(\),)h Fs(vertical)e(tab)p Ft(,)i
Fs(form)g(feed)p Ft(,)g(and)g Fs(carriage)f(r)m(eturn)p
Ft(.)166 4090 y Fg(5.20.2)197 b(Anchoring)202 4446 y
Fl(\017)91 b Fp(\(string-start\))h Fl(!)f Fs(r)m(eg-exp)202
4672 y Fl(\017)g Fp(\(string-end\))h Fl(!)f Fs(r)m(eg-exp)166
5024 y Fp(String-start)46 b Ft(r)m(eturns)f(a)g(r)m(egular)g(expr)m
(ession)g(that)h(matches)e(the)i(beginning)e(of)i(the)f(string)166
5250 y(being)g(matched)g(against;)h(string-end)f(r)m(eturns)f(one)i
(that)g(matches)f(the)g(end.)166 5775 y Fg(5.20.3)197
b(Composite)50 b(expressions)202 6131 y Fl(\017)91 b
Fp(\(sequence)h Fs(r)m(eg-exp)d(.)27 b(.)g(.)g Fp(\))104
b Fl(!)91 b Fs(r)m(eg-exp)202 6357 y Fl(\017)g Fp(\(one-of)h
Fs(r)m(eg-exp)d(.)27 b(.)g(.)g Fp(\))104 b Fl(!)91 b
Fs(r)m(eg-exp)166 6709 y Fp(Sequence)56 b Ft(matches)g(the)g
(concatenation)f(of)h(its)g(ar)m(guments,)h Fp(one-of)g
Ft(matches)e(any)g(one)h(of)166 6934 y(its)46 b(ar)m(guments.)202
7286 y Fl(\017)91 b Fp(\(text)h Fs(string)p Fp(\))d Fl(!)i
Fs(r)m(eg-exp)166 7638 y Fp(Text)46 b Ft(r)m(eturns)f(a)g(r)m(egular)f
(expr)m(ession)i(that)g(matches)e(the)i(characters)f(in)g
Fs(string)p Ft(,)f(in)i(or)m(der)-13 b(.)202 7990 y Fl(\017)91
b Fp(\(repeat)h Fs(r)m(eg-exp)p Fp(\))d Fl(!)i Fs(r)m(eg-exp)202
8216 y Fl(\017)g Fp(\(repeat)h Fs(count)e(r)m(eg-exp)p
Fp(\))f Fl(!)i Fs(r)m(eg-exp)202 8442 y Fl(\017)g Fp(\(repeat)h
Fs(min)f(max)g(r)m(eg-exp)p Fp(\))e Fl(!)i Fs(r)m(eg-exp)166
8794 y Fp(Repeat)51 b Ft(r)m(eturns)e(a)h(r)m(egular)f(expr)m(ession)h
(that)g(matches)g(zer)m(o)g(or)g(mor)m(e)f(occur)m(ences)g(of)h(its)g
Fs(r)m(eg-)166 9020 y(exp)64 b Ft(ar)m(gument.)112 b(W)-10
b(ith)65 b(no)f(count)g(the)h(r)m(esult)f(will)f(match)h(any)g(number)f
(of)h(times)h(\()p Fs(r)m(eg-exp)p Ft(*\).)166 9245 y(W)-10
b(ith)45 b(a)h(single)f(count)g(the)h(r)m(eturned)f(expr)m(ession)g
(will)g(match)g Fs(r)m(eg-exp)e Ft(exactly)j(that)f(number)f(of)166
9471 y(times.)87 b(The)56 b(\002nal)f(case)g(will)g(match)g(fr)m(om)f
Fs(min)i Ft(to)g Fs(max)g Ft(r)m(epetitions,)j(inclusive.)86
b Fs(Max)54 b Ft(may)h(be)166 9697 y Fp(#f)p Ft(,)65
b(in)60 b(which)f(case)h(ther)m(e)g(is)h(no)f(maximum)f(number)f(of)j
(matches.)101 b Fs(Count)60 b Ft(and)g Fs(min)g Ft(should)166
9923 y(be)43 b(exact,)i(non-negative)e(integers;)i Fs(max)f
Ft(should)f(either)h(be)f(an)h(exact)f(non-negative)g(integer)h(or)166
10149 y Fp(#f)p Ft(.)166 10673 y Fg(5.20.4)197 b(Case)50
b(sensitivity)166 11032 y Ft(Regular)45 b(expr)m(essions)h(ar)m(e)f
(normally)g(case-sensitive.)202 11417 y Fl(\017)91 b
Fp(\(ignore-case)h Fs(r)m(eg-exp)p Fp(\))d Fl(!)i Fs(r)m(eg-exp)202
11643 y Fl(\017)g Fp(\(use-case)h Fs(r)m(eg-exp)p Fp(\))d
Fl(!)i Fs(r)m(eg-exp)3495 12141 y Ft(61)p eop end
%%Page: 62 70
TeXDict begin 62 69 bop 332 1146 a Ft(The)60 b(value)f(r)m(eturned)g
(by)g Fp(ignore-case)i Ft(is)f(identical)f(its)h(ar)m(gument)e(except)i
(that)g(case)g(will)332 1372 y(be)81 b(ignor)m(ed)f(when)g(matching.)
162 b(The)82 b(value)e(r)m(eturned)g(by)g Fp(use-case)i
Ft(is)f(pr)m(otected)g(fr)m(om)332 1597 y(futur)m(e)64
b(applications)h(of)g Fp(ignore-case)p Ft(.)117 b(The)66
b(expr)m(essions)f(r)m(eturned)g(by)f Fp(use-case)i Ft(and)332
1823 y Fp(ignore-case)50 b Ft(ar)m(e)e(unaf)m(fected)f(by)h(later)h
(uses)f(of)h(the)f(these)h(pr)m(ocedur)m(es.)66 b(By)49
b(way)f(of)g(exam-)332 2049 y(ple,)e(the)g(following)f(matches)g
Fp("ab")g Ft(but)g(not)h Fp("aB")p Ft(,)g Fp("Ab")p Ft(,)h(or)e
Fp("AB")p Ft(.)663 2394 y Fp(\(text)109 b("ab"\))332
2739 y Ft(while)663 3084 y Fp(\(ignore-case)h(\(test)g("ab"\)\))332
3429 y Ft(matches)45 b Fp("ab")p Ft(,)h Fp("aB")p Ft(,)h
Fp("Ab")p Ft(,)f(and)f Fp("AB")h Ft(and)663 3774 y Fp(\(ignore-case)110
b(\(sequence)g(\(text)f("a"\))3172 4000 y(\(use-case)h(\(text)f
("b"\)\)\)\))332 4345 y Ft(matches)45 b Fp("ab")h Ft(and)f
Fp("Ab")h Ft(but)f(not)h Fp("aB")f Ft(or)h Fp("AB")p
Ft(.)332 4848 y Fg(5.20.5)197 b(Submatches)50 b(and)f(matching)332
5202 y Ft(A)56 b(subexpr)m(ession)e(within)h(a)g(lar)m(ger)g(expr)m
(ession)g(can)g(be)g(marked)g(as)g(a)h(submatch.)84 b(When)55
b(an)332 5428 y(expr)m(ession)46 b(is)h(matched)e(against)i(a)f
(string,)h(the)f(success)g(or)g(failur)m(e)f(of)h(each)g(submatch)f
(within)332 5654 y(that)58 b(expr)m(ession)g(is)f(r)m(eported,)62
b(as)57 b(well)g(as)h(the)g(location)f(of)h(the)f(substring)g(matched)g
(be)h(each)332 5879 y(successful)44 b(submatch.)368 6191
y Fl(\017)91 b Fp(\(submatch)h Fs(key)e(r)m(eg-exp)p
Fp(\))f Fl(!)i Fs(r)m(eg-exp)368 6417 y Fl(\017)g Fp(\(no-submatches)h
Fs(r)m(eg-exp)p Fp(\))e Fl(!)g Fs(r)m(eg-exp)332 6729
y Fp(Submatch)52 b Ft(r)m(eturns)e(a)g(r)m(egular)g(expr)m(ession)h
(that)g(matches)f(its)h(ar)m(gument)f(and)h(causes)f(the)h(r)m(e-)332
6955 y(sult)64 b(of)g(matching)g(its)g(ar)m(gument)f(to)i(be)f(r)m
(eported)h(by)f(the)g Fp(match)h Ft(pr)m(ocedur)m(e.)113
b Fs(Key)64 b Ft(is)g(used)332 7181 y(to)50 b(indicate)f(the)g(r)m
(esult)g(of)g(this)g(particular)f(submatch)g(in)h(the)g(alist)h(of)f
(successful)e(submatches)332 7406 y(r)m(eturned)61 b(by)h
Fp(match)p Ft(.)106 b(Any)62 b(value)f(may)g(be)g(used)h(as)g(a)f
Fs(key)p Ft(.)105 b Fp(No-submatches)63 b Ft(r)m(eturns)e(an)332
7632 y(expr)m(ession)46 b(identical)f(to)h(its)f(ar)m(gument,)g(except)
h(that)g(all)f(submatches)f(have)h(been)g(elided.)368
7944 y Fl(\017)91 b Fp(\(any-match?)103 b Fs(r)m(eg-exp)89
b(string)p Fp(\))h Fl(!)g Fs(boolean)368 8170 y Fl(\017)h
Fp(\(exact-match?)103 b Fs(r)m(eg-exp)89 b(string)p Fp(\))h
Fl(!)h Fs(boolean)368 8396 y Fl(\017)g Fp(\(match)h Fs(r)m(eg-exp)d
(string)p Fp(\))g Fl(!)i Fs(match)g(or)f Fp(#f)368 8621
y Fl(\017)h Fp(\(match-start)h Fs(match)p Fp(\))f Fl(!)g
Fs(index)368 8847 y Fl(\017)g Fp(\(match-end)h Fs(match)p
Fp(\))f Fl(!)f Fs(index)368 9073 y Fl(\017)h Fp(\(match-submatches)i
Fs(match)p Fp(\))d Fl(!)h Fs(alist)332 9385 y Fp(Any-match?)102
b Ft(r)m(eturns)60 b Fp(#t)g Ft(if)g Fs(string)f Ft(matches)h
Fs(r)m(eg-exp)f Ft(or)h(contains)g(a)h(substring)e(that)i(does,)332
9611 y(and)48 b Fp(#f)f Ft(otherwise.)64 b Fp(Exact-match?)g
Ft(r)m(eturns)46 b Fp(#t)i Ft(if)f Fs(string)f Ft(matches)i
Fs(r)m(eg-exp)d Ft(and)j Fp(#f)g Ft(other)m(-)332 9836
y(wise.)614 10062 y Fp(Match)65 b Ft(r)m(eturns)f Fp(#f)h
Ft(if)f Fs(r)m(eg-exp)e Ft(does)j(not)g(match)f Fs(string)f
Ft(and)h(a)g(match)g(r)m(ecor)m(d)g(if)g(it)h(does)332
10288 y(match.)f(A)48 b(match)g(r)m(ecor)m(d)f(contains)h(thr)m(ee)f
(values:)62 b(the)48 b(beginning)f(and)h(end)g(of)g(the)g(substring)332
10514 y(that)68 b(matched)f(the)g(pattern)h(and)g(an)f(a-list)g(of)g
(submatch)f(keys)i(and)g(corr)m(esponding)f(match)332
10740 y(r)m(ecor)m(ds)c(for)h(any)g(submatches)e(that)j(also)f
(matched.)111 b Fp(Match-start)65 b Ft(r)m(eturns)f(the)g(index)f(of)
332 10966 y(the)55 b(\002rst)h(character)e(in)h(the)g(matching)f
(substring)g(and)h Fp(match-end)h Ft(gives)f(index)g(of)g(the)g
(\002rst)332 11191 y(character)d(after)h(the)h(matching)e(substring.)80
b Fp(Match-submatches)54 b Ft(r)m(eturns)f(an)g(alist)g(of)g(sub-)332
11417 y(match)g(keys)i(and)f(match)f(r)m(ecor)m(ds.)83
b(Only)53 b(the)i(top)g(match)e(r)m(ecor)m(d)g(r)m(eturned)h(by)g
Fp(match)g Ft(has)g(a)332 11643 y(submatch)44 b(alist.)3661
12141 y(62)p eop end
%%Page: 63 71
TeXDict begin 63 70 bop 448 1146 a Ft(Matching)45 b(occurs)f(accor)m
(ding)f(to)j(POSIX.)g(The)f(match)f(r)m(eturned)g(is)h(the)f(one)h
(with)g(the)g(low-)166 1372 y(est)64 b(starting)g(index)g(in)f
Fs(string)p Ft(.)111 b(If)63 b(ther)m(e)h(is)g(mor)m(e)f(than)h(one)g
(such)f(match,)68 b(the)c(longest)g(is)g(r)m(e-)166 1597
y(turned.)57 b(W)-10 b(ithin)45 b(that)g(match)g(the)h(longest)g
(possible)f(submatches)f(ar)m(e)h(r)m(eturned.)448 1823
y(All)64 b(thr)m(ee)f(matching)f(pr)m(ocedur)m(es)h(cache)g(a)g
(compiled)g(version)g(of)g Fs(r)m(eg-exp)p Ft(.)109 b(Subsequent)166
2049 y(calls)45 b(with)g(the)h(same)f Fs(r)m(eg-exp)e
Ft(will)i(be)g(mor)m(e)g(ef)m(\002cient.)448 2275 y(The)56
b(C)f(interface)f(to)i(the)g(POSIX)f(r)m(egular)g(expr)m(ession)g(code)
g(uses)g(ASCII)i Fp(nul)e Ft(as)h(an)e(end-)166 2501
y(of-string)61 b(marker)-13 b(.)106 b(The)62 b(matching)f(pr)m(ocedur)m
(es)h(will)f(ignor)m(e)h(any)g(characters)f(following)g(an)166
2726 y(embedded)45 b(ASCII)i Fp(nul)p Ft(s)f(in)f Fs(string)p
Ft(.)497 3129 y Fp(\(define)109 b(pattern)h(\(text)g("abc"\)\))497
3355 y(\(any-match?)g(pattern)g("abc"\))982 b Fl(!)109
b Fp(#t)497 3581 y(\(any-match?)h(pattern)g("abx"\))982
b Fl(!)109 b Fp(#f)497 3806 y(\(any-match?)h(pattern)g("xxabcxx"\))546
b Fl(!)109 b Fp(#t)497 4258 y(\(exact-match?)h(pattern)g("abc"\))764
b Fl(!)109 b Fp(#t)497 4484 y(\(exact-match?)h(pattern)g("abx"\))764
b Fl(!)109 b Fp(#f)497 4710 y(\(exact-match?)h(pattern)g("xxabcxx"\))
328 b Fl(!)109 b Fp(#f)497 5161 y(\(match)g(pattern)h("abc"\))1528
b Fl(!)109 b Fp(\(#)p Fl(f)p Fp(match)g(0)h(3)p Fl(g)p
Fp(\))497 5387 y(\(match)f(pattern)h("abx"\))1528 b Fl(!)109
b Fp(#f)497 5613 y(\(match)g(pattern)h("xxabcxx"\))1092
b Fl(!)109 b Fp(\(#)p Fl(f)p Fp(match)g(2)h(5)p Fl(g)p
Fp(\))497 6065 y(\(let)f(\(\(x)h(\(match)f(\(sequence)h(\(text)g
("ab"\))3333 6290 y(\(submatch)g('foo)f(\(text)h("cd"\)\))3333
6516 y(\(text)g("ef"\)\))2242 6742 y("xxxabcdefxx"\)\)\))715
6968 y(\(list)f(x)h(\(match-submatches)g(x\)\)\))715
7194 y Fl(!)f Fp(\(#)p Fl(f)p Fp(match)g(3)h(9)p Fl(g)f
Fp(\(\(foo)g(.)g(#)p Fl(f)p Fp(match)h(5)f(7)p Fl(g)p
Fp(\)\))497 7645 y(\(match-submatches)715 7871 y(\(match)h(\(sequence)
1697 8097 y(\(set)f("a"\))1697 8323 y(\(one-of)g(\(submatch)h('foo)g
(\(text)f("bc"\)\))2569 8549 y(\(submatch)h('bar)g(\(text)f
("BC"\)\)\)\))1479 8774 y("xxxaBCd"\)\))715 9000 y Fl(!)g
Fp(\(\(bar)g(.)h(#)p Fl(f)p Fp(match)f(4)g(6)p Fl(g)p
Fp(\)\))166 9594 y Fm(5.21)238 b(SRFIs)166 10016 y Ft(`SRFI')94
b(stands)g(for)f(`Scheme)g(Request)h(For)g(Implementation'.)201
b(An)94 b(SRFI)h(is)f(a)g(descrip-)166 10241 y(tion)103
b(of)f(an)g(extension)g(to)h(standar)m(d)f(Scheme.)227
b(Draft)101 b(and)h(\002nal)g(SRFI)i(documents,)116 b(a)166
10467 y(F)-13 b(AQ,)95 b(and)f(other)g(information)f(about)h(SRFIs)h
(can)f(be)g(found)f(at)h(the)h(SRFI)g(web)e(site)i(at)166
10693 y Fp(http://srfi.schemers.org)p Ft(.)448 10919
y(Scheme)45 b(48)h(includes)e(implementations)i(of)f(the)h(following)e
(\(\002nal\))h(SRFIs:)439 11275 y Fl(\017)91 b Ft(SRFI)46
b(1)g(\226)f(List)h(Library)439 11643 y Fl(\017)91 b
Ft(SRFI)46 b(2)g(\226)f Fp(and-let*)3495 12141 y Ft(63)p
eop end
%%Page: 64 72
TeXDict begin 64 71 bop 605 1146 a Fl(\017)91 b Ft(SRFI)46
b(5)g(\226)f Fp(let)h Ft(with)f(signatur)m(es)g(and)g(r)m(est)h(ar)m
(guments)605 1530 y Fl(\017)91 b Ft(SRFI)46 b(6)g(\226)f(Basic)g
(string)h(ports)605 1914 y Fl(\017)91 b Ft(SRFI)46 b(7)g(\226)f(Pr)m
(ogram)g(con\002guration)605 2299 y Fl(\017)91 b Ft(SRFI)46
b(8)g(\226)f Fp(receive)605 2683 y Fl(\017)91 b Ft(SRFI)46
b(9)g(\226)f(De\002ning)g(r)m(ecor)m(d)g(types)605 3067
y Fl(\017)91 b Ft(SRFI)46 b(11)g(\226)f(Syntax)h(for)f(r)m(eceiving)f
(multiple)h(values)605 3452 y Fl(\017)91 b Ft(SRFI)46
b(13)g(\226)f(String)h(Library)605 3836 y Fl(\017)91
b Ft(SRFI)46 b(14)g(\226)f(Character)m(-Set)g(Library)f(\(see)i(note)g
(below\))605 4221 y Fl(\017)91 b Ft(SRFI)46 b(16)g(\226)f(Syntax)h(for)
f(pr)m(ocedur)m(es)g(of)g(variable)f(arity)605 4605 y
Fl(\017)91 b Ft(SRFI)46 b(17)g(\226)f(Generalized)g Fp(set!)605
4989 y Fl(\017)91 b Ft(SRFI)46 b(22)g(\226)f(Running)g(Scheme)g
(Scripts)h(on)g(Unix)605 5374 y Fl(\017)91 b Ft(SRFI)46
b(23)g(\226)f(Err)m(or)g(r)m(eporting)h(mechanism)605
5758 y Fl(\017)91 b Ft(SRFI)46 b(25)g(\226)f(Multi-dimensional)f(Array)
i(Primitives)605 6142 y Fl(\017)91 b Ft(SRFI)46 b(26)g(\226)f(Notation)
h(for)f(Specializing)h(Parameters)e(without)i(Currying)605
6527 y Fl(\017)91 b Ft(SRFI)46 b(27)g(\226)f(Sour)m(ces)g(of)h(Random)f
(Bits)605 6911 y Fl(\017)91 b Ft(SRFI)46 b(28)g(\226)f(Basic)g(Format)h
(Strings)605 7295 y Fl(\017)91 b Ft(SRFI)46 b(31)g(\226)f(A)h(special)f
(form)g Fp(rec)h Ft(for)f(r)m(ecursive)f(evaluation)605
7680 y Fl(\017)91 b Ft(SRFI)46 b(37)g(\226)f(ar)m(gs-fold:)56
b(a)45 b(pr)m(ogram)g(ar)m(gument)f(pr)m(ocessor)605
8064 y Fl(\017)91 b Ft(SRFI)46 b(42)g(\226)f(Eager)g(Compr)m(ehensions)
605 8449 y Fl(\017)91 b Ft(SRFI)46 b(45)g(\226)f(Primitives)g(for)g
(Expr)m(essing)g(Iterative)h(Lazy)f(Algorithms)332 8833
y(Documentation)g(on)g(these)h(can)f(be)g(found)g(at)h(the)f(web)g
(site)h(mentioned)f(above.)614 9061 y(SRFI)37 b(14)e(includes)g(the)g
(pr)m(ocedur)m(e)g Fp(->char-set)h Ft(which)e(is)i(not)f(a)h(standar)m
(d)f(Scheme)g(iden-)332 9287 y(ti\002er)46 b(\(in)e(R)1144
9221 y Fn(5)1223 9287 y Ft(RS)j(the)e(only)h(r)m(equir)m(ed)e
(identi\002er)h(starting)h(with)f Fp(-)g Ft(is)h Fp(-)f
Ft(itself\).)56 b(In)46 b(the)f(Scheme)g(48)332 9513
y(version)g(of)h(SRFI)g(14)g(we)f(have)g(r)m(enamed)f
Fp(->char-set)j Ft(as)e Fp(x->char-set)p Ft(.)614 9741
y(The)38 b(SRFI)h(bindings)d(can)h(be)g(accessed)g(either)g(by)g
(opening)h(the)g(appr)m(opriate)f(str)o(uctur)m(e)f(\(the)332
9967 y(str)o(uctur)m(e)k Fp(srfi-)p Fs(n)h Ft(contains)g(SRFI)h
Fs(n)p Ft(\))e(or)h(by)g(loading)g(str)o(uctur)m(e)e
Fp(srfi-7)j Ft(and)f(then)f(using)h(the)332 10192 y Fp
(,load-srfi-7-program)i Ft(command)c(to)i(load)g(an)g(SRFI)h(7-style)e
(pr)m(ogram.)55 b(The)41 b(syntax)f(for)332 10418 y(the)46
b(command)e(is)663 10805 y Fp(,load-srfi-7-program)111
b Fs(name)e(\002lename)332 11189 y Ft(This)40 b(cr)m(eates)g(a)g(new)f
(str)o(uctur)m(e)g(and)g(associated)i(package,)g(binds)e(the)h(str)o
(uctur)m(e)f(to)h Fs(name)g Ft(in)g(the)332 11415 y(con\002guration)e
(package,)j(and)d(then)h(loads)f(the)h(pr)m(ogram)f(found)g(in)g
Fs(\002lename)g Ft(into)h(the)g(package.)614 11643 y(As)46
b(an)g(example,)f(if)g(the)h(\002le)f Fp(test.scm)h Ft(contains)3661
12141 y(64)p eop end
%%Page: 65 73
TeXDict begin 65 72 bop 497 1146 a Fp(\(program)110 b(\(code)f
(\(define)h(x)f(10\)\)\))166 1521 y Ft(this)46 b(pr)m(ogram)e(can)h(be)
g(loaded)h(as)g(follows:)497 1896 y Fp(>)109 b(,load-package)h(srfi-7)
497 2122 y(>)f(,load-srfi-7-program)i(test)e(test.scm)497
2348 y([test])497 2574 y(>)g(,in)g(test)497 2800 y(test>)g(x)497
3025 y(10)497 3251 y(test>)3495 12141 y Ft(65)p eop end
%%Page: 66 74
TeXDict begin 66 73 bop 332 2391 a Fo(Chapter)87 b(6)332
3221 y Fr(Threads)332 4111 y Ft(This)92 b(chapter)f(describes)g(Scheme)
h(48's)f(thr)m(ead)g(system:)149 b(Scheme)91 b(48)h(thr)m(eads)f(ar)m
(e)g(fully)332 4337 y(pr)m(eemptive;)102 b(all)83 b(thr)m(eads)g
(\(curr)m(ently\))e(r)o(un)h(within)h(a)g(single)g(operating)g(system)h
(pr)m(ocess.)332 4563 y(Scheme)47 b(48)f(allows)h(writing)f
(customized,)h(nested)g(schedulers,)g(and)g(pr)m(ovides)g(numer)m(ous)e
(fa-)332 4789 y(cilities)d(for)f(the)h(synchr)m(onization)f(of)h(shar)m
(ed-memory)e(pr)m(ograms,)j(most)f(importantly)g Fs(pr)m(opos-)332
5015 y(als)j Ft(for)g(optimistic)g(concurr)m(ency)-20
b(.)332 5603 y Fm(6.1)238 b(Creating)58 b(and)h(controlling)g(threads)
332 6025 y Ft(The)46 b(bindings)f(described)g(in)g(this)g(section)h(ar)
m(e)f(part)h(of)f(the)g Fp(threads)i Ft(str)o(uctur)m(e.)368
6359 y Fl(\017)91 b Fp(\(spawn)h Fs(thunk)q Fp(\))e Fl(!)h
Fs(thr)m(ead)368 6585 y Fl(\017)g Fp(\(spawn)h Fs(thunk)e(name)p
Fp(\))h Fl(!)g Fs(thr)m(ead)332 6919 y Fp(Spawn)45 b
Ft(cr)m(eates)f(a)g(new)f(thr)m(ead,)i(passes)g(that)f(thr)m(ead)g(to)h
(the)f(curr)m(ent)f(scheduler)-13 b(,)44 b(and)g(instr)o(ucts)332
7145 y(the)50 b(scheduler)f(to)h(r)o(un)f Fs(thunk)g
Ft(in)g(that)h(thr)m(ead.)70 b(The)50 b Fs(name)g Ft(ar)m(gument)e(\(a)
h(symbol\))g(associates)h(a)332 7371 y(symbolic)45 b(name)f(with)i(the)
f(thr)m(ead;)h(it)f(is)h(pur)m(ely)f(for)g(debugging)g(purposes.)368
7705 y Fl(\017)91 b Fp(\(relinquish-timeslice)r(\))368
7931 y Fl(\017)g Fp(\(sleep)h Fs(time-in-milliseconds)p
Fp(\))368 8157 y Fl(\017)f Fp(\(terminate-current-thread)s(\))332
8491 y(Relinquish-timeslice)59 b Ft(instr)o(ucts)e(the)g(scheduler)g
(to)g(r)o(un)g(another)g(thr)m(ead,)j(thus)d(r)m(elin-)332
8717 y(quishing)40 b(the)i(timeslice)f(of)g(the)g(curr)m(ent)f(thr)m
(ead.)55 b Fp(Sleep)42 b Ft(does)g(the)f(same)g(and)g(asks)g(the)h
(sched-)332 8942 y(uler)51 b(to)h(suspend)f(the)g(curr)m(ent)g(thr)m
(ead)g(for)g(at)g(least)h Fs(time-in-milliseconds)46
b Ft(milliseconds)51 b(befor)m(e)332 9168 y(r)m(esuming)44
b(it.)57 b(Finally)-20 b(,)46 b Fp(terminate-current-thread)h
Ft(terminates)f(the)f(curr)m(ent)f(thr)m(ead.)614 9394
y(Each)56 b(thr)m(ead)h(is)f(r)m(epr)m(esented)h(by)f(a)g(thr)m(ead)g
(object.)90 b(The)57 b(following)f(pr)m(ocedur)m(es)f(operate)332
9620 y(on)46 b(that)f(object:)368 9954 y Fl(\017)91 b
Fp(\(current-thread\))i Fl(!)d Fs(thr)m(ead)368 10180
y Fl(\017)h Fp(\(thread?)103 b Fs(thing)p Fp(\))90 b
Fl(!)h Fs(boolean)368 10406 y Fl(\017)g Fp(\(thread-name)h
Fs(thr)m(ead)p Fp(\))e Fl(!)g Fs(name)368 10631 y Fl(\017)h
Fp(\(thread-uid)h Fs(thr)m(ead)p Fp(\))d Fl(!)i Fs(integer)332
10966 y Fp(Current-thread)74 b Ft(r)m(eturns)e(the)g(thr)m(ead)h
(object)f(associated)g(with)h(the)f(curr)m(ently)g(r)o(unning)332
11191 y(thr)m(ead.)56 b Fp(Thread?)g Ft(is)44 b(the)g(pr)m(edicate)f
(for)h(thr)m(ead)f(objects.)56 b Fp(Thread-name)44 b
Ft(extracts)g(the)g(name)332 11417 y(of)57 b(the)g(thr)m(ead,)j(if)c
(one)h(was)f(speci\002ed)h(in)g(the)g(call)f(to)i Fp(spawn)p
Ft(,)i Fp(#f)d Ft(otherwise.)91 b Fp(Thread-uid)332 11643
y Ft(r)m(eturns)45 b(the)g Fs(uid)g Ft(of)h(the)f(thr)m(ead,)h(a)f
(unique)g(integer)g(assigned)h(by)f(the)g(thr)m(ead)h(system.)3661
12141 y(66)p eop end
%%Page: 67 75
TeXDict begin 67 74 bop 166 1146 a Fm(6.2)238 b(Advanced)59
b(thread)g(handling)166 1576 y Ft(The)46 b(following)f(bindings)f(ar)m
(e)h(part)h(of)f(the)h Fp(threads-internal)h Ft(str)o(uctur)m(e:)202
1969 y Fl(\017)91 b Fp(\(terminate-thread!)i Fs(thr)m(ead)p
Fp(\))202 2194 y Fl(\017)e Fp(\(kill-thread!)h Fs(thr)m(ead)p
Fp(\))166 2587 y(Terminate-thread!)56 b Ft(unwinds)38
b(the)i(thr)m(ead)f(associated)h(with)f Fs(thr)m(ead)p
Ft(,)g(r)o(unning)f(any)h(pend-)166 2812 y(ing)61 b Fp(dynamic-wind)h
Fs(after)e Ft(thunks)h(\(in)f(that)i(thr)m(ead\),)j(after)60
b(which)g(the)i(thr)m(ead)f(terminates.)166 3038 y Fp(Kill-thread!)114
b Ft(causes)64 b(the)g(thr)m(ead)g(associated)h(with)e
Fs(thr)m(ead)g Ft(to)i(terminate)f(immediately)166 3264
y(without)45 b(unwinding)f(its)i(continuation.)166 3887
y Fm(6.3)238 b(Debugging)59 b(multithreaded)e(programs)166
4318 y Ft(Debugging)44 b(multithr)m(eaded)h(pr)m(ograms)g(can)g(be)g
(dif)m(\002cult.)448 4548 y(As)62 b(described)e(in)h(section)g(3.11,)k
(when)60 b(any)h(thr)m(ead)f(signals)h(an)g(err)m(or)-13
b(,)64 b(Scheme)c(48)h(stops)166 4774 y(r)o(unning)44
b(all)h(of)g(the)h(thr)m(eads)f(at)h(that)g(command)e(level.)448
5004 y(The)55 b(following)e(pr)m(ocedur)m(e)g(\(exported)i(by)e(the)i
(str)o(uctur)m(e)d Fp(debug-messages)p Ft(\))j(is)f(useful)166
5230 y(in)45 b(debugging)g(multi-thr)m(eaded)f(pr)m(ograms.)202
5622 y Fl(\017)91 b Fp(\(debug-message)h Fs(element)2569
5649 y Fn(0)2738 5622 y Fs(.)27 b(.)g(.)g Fp(\))166 6014
y(Debug-message)58 b Ft(prints)e(the)h(elements)g(to)g(`)p
Fp(stderr)p Ft(',)i(followed)d(by)g(a)h(newline.)89 b(The)57
b(only)166 6240 y(types)86 b(of)f(values)f(that)h Fp(debug-message)i
Ft(prints)e(in)f(full)g(ar)m(e)h(small)f(integers)i(\(\002xnums\),)166
6466 y(strings,)63 b(characters,)e(symbols,)h(booleans,)h(and)58
b(the)h(empty)g(list.)97 b(V)-17 b(alues)59 b(of)f(other)h(types)g(ar)m
(e)166 6692 y(abbr)m(eviated)44 b(as)i(follows:)1785
7040 y(pair)695 b Fp(\(...\))1785 7266 y Ft(vector)519
b Fp(#\(...\))1785 7492 y Ft(pr)m(ocedur)m(e)198 b Fp(#)p
Fl(f)p Fp(procedure)p Fl(g)1785 7718 y Ft(r)m(ecor)m(d)504
b Fp(#)p Fl(f)p Fp(<name)110 b(of)f(record)h(type>)p
Fl(g)1785 7943 y Ft(all)45 b(others)278 b Fp(???)166
8327 y Ft(The)37 b(gr)m(eat)g(thing)f(about)h Fp(debug-message)h
Ft(is)e(that)h(it)g(bypasses)g(Scheme)g(48's)f(I/O)h(and)f(thr)m(ead)
166 8552 y(handling.)56 b(The)46 b(message)f(appears)h(immediately)-20
b(,)45 b(with)g(no)h(delays)g(or)f(err)m(ors.)166 9176
y Fm(6.4)238 b(Optimistic)58 b(concurrency)166 9606 y
Ft(Most)50 b(of)f(the)h(bindings)f(described)g(in)g(this)g(section)h
(ar)m(e)f(part)g(of)h(the)f Fp(proposals)i Ft(str)o(uctur)m(e\227)166
9832 y(the)95 b(low-level)e(bindings)h(described)f(at)i(the)g(very)f
(end)g(of)g(the)h(section)f(ar)m(e)g(part)h(of)f(the)166
10058 y Fp(low-proposals)47 b Ft(str)o(uctur)m(e.)448
10288 y(A)55 b Fs(pr)m(oposal)d Ft(is)i(a)g(r)m(ecor)m(d)f(of)h(r)m
(eads)g(fr)m(om)f(and)g(and)h(writes)g(to)h(locations)f(in)g(memory)-20
b(.)81 b(Each)166 10514 y(thr)m(ead)57 b(has)h(an)f(associated)h
Fs(curr)m(ent)f(pr)m(oposal)e Ft(\(which)h(may)h(be)h
Fp(#f)p Ft(\).)93 b(The)58 b Fs(logging)e Ft(operations)166
10740 y(listed)37 b(below)f(r)m(ecor)m(d)g(any)g(values)g(r)m(ead)g(or)
h(written)f(in)h(the)f(curr)m(ent)g(pr)m(oposal.)54 b(A)37
b(r)m(eading)f(oper)m(-)166 10966 y(ation,)45 b(such)e(as)h
Fp(provisional-vector-ref)p Ft(,)j(\002rst)d(checks)f(to)i(see)f(if)g
(the)g(curr)m(ent)f(pr)m(oposal)166 11191 y(contains)51
b(a)g(value)g(for)g(the)h(r)m(elevent)f(location.)74
b(If)51 b(so,)j(that)e(value)e(is)i(r)m(eturned)e(as)i(the)f(r)m(esult)
g(of)166 11417 y(the)40 b(r)m(ead.)55 b(If)40 b(not,)i(the)f(curr)m
(ent)e(contents)h(of)g(the)h(location)f(ar)m(e)g(stor)m(ed)g(in)g(the)g
(pr)m(oposal)h(and)f(then)166 11643 y(r)m(eturned)g(as)h(the)f(r)m
(esult)h(of)f(the)h(r)m(ead.)55 b(A)41 b(logging)g(write)f(to)h(a)g
(location)f(stor)m(es)h(the)g(new)f(value)g(as)3495 12141
y(67)p eop end
%%Page: 68 76
TeXDict begin 68 75 bop 332 1146 a Ft(the)40 b(curr)m(ent)e(contents)h
(of)g(the)h(location)f(in)g(the)h(curr)m(ent)e(pr)m(oposal;)k(the)e
(contents)f(of)h(the)f(location)332 1372 y(itself)45
b(r)m(emain)g(unchanged.)614 1597 y Fs(Committing)65
b Ft(to)h(a)g(pr)m(oposal)g(veri\002es)g(that)g(any)f(r)m(eads)h
(logged)g(in)g(the)f(pr)m(oposal)i(ar)m(e)e(still)332
1823 y(valid)j(and,)75 b(if)69 b(so,)75 b(performs)68
b(any)h(writes)g(that)g(the)g(pr)m(oposal)g(contains.)127
b(A)69 b(logged)h(r)m(ead)e(is)332 2049 y(valid)55 b(if,)i(at)e(the)g
(time)g(of)g(the)g(commit,)i(the)e(location)g(contains)g(the)g(same)g
(value)f(it)h(had)g(at)g(the)332 2275 y(time)43 b(of)g(the)h(original)f
(r)m(ead)f(\(note)i(that)f(this)g(does)h(not)g(mean)e(that)i(no)f
(change)g(occur)m(ed,)g(simply)332 2501 y(that)59 b(the)f(value)g(now)g
(is)h(the)f(same)h(as)f(the)h(value)e(then\).)96 b(If)58
b(a)g(pr)m(oposal)h(has)g(an)f(invalid)f(r)m(ead)332
2726 y(then)i(the)g(ef)m(fort)f(to)h(commit)f(fails;)65
b(no)59 b(change)f(is)h(made)g(to)g(the)g(value)f(of)g(any)h(location.)
97 b(The)332 2952 y(veri\002cations)40 b(and)g(subsequent)f(writes)h
(to)h(memory)f(ar)m(e)g(performed)f(atomically)h(with)g(r)m(espect)332
3178 y(to)46 b(other)g(pr)m(oposal)g(commit)f(attempts.)368
3510 y Fl(\017)91 b Fp(\(call-ensuring-atomicity)i Fs(thunk)q
Fp(\))e Fl(!)f Fs(value)g(.)27 b(.)g(.)368 3735 y Fl(\017)91
b Fp(\(call-ensuring-atomicity!)i Fs(thunk)q Fp(\))368
3961 y Fl(\017)e Fp(\(ensure-atomicity)i Fs(exp)d Fp(...\))46
b Fl(!)f Fs(value)g(.)27 b(.)g(.)2467 b Ft(syntax)368
4187 y Fl(\017)91 b Fp(\(ensure-atomicity!)i Fs(exp)d
Fp(...\))3260 b Ft(syntax)332 4518 y(If)248 b(ther)m(e)g(is)h(a)f(pr)m
(oposal)h(in)f(place)g Fp(call-ensuring-atomicity)i Ft(and)332
4744 y Fp(call-ensuring-atomicity!)193 b Ft(simply)91
b(make)f(a)g(\(tail-r)m(ecursive\))e(call)h(to)i Fs(thunk)p
Ft(.)191 b(If)332 4970 y(the)57 b(curr)m(ent)f(pr)m(oposal)i(is)f
Fp(#f)g Ft(they)g(cr)m(eate)g(a)g(new)f(pr)m(oposal,)61
b(install)c(it,)j(call)d Fs(thunk)p Ft(,)i(and)e(then)332
5196 y(try)e(to)g(commit)e(to)i(the)g(pr)m(oposal.)85
b(This)54 b(pr)m(ocess)h(r)m(epeats,)i(with)d(a)h(new)f(pr)m(oposal)h
(on)f(each)g(it-)332 5422 y(eration,)f(until)e(the)g(commit)f
(succeeds.)73 b Fp(Call-ensuring-atomicity)53 b Ft(r)m(eturns)e
(whatever)332 5648 y(values)77 b(ar)m(e)g(r)m(eturned)g(by)g
Fs(thunk)g Ft(on)g(its)h(\002nal)f(invocation,)86 b(while)77
b Fp(ensure-atomicity!)332 5873 y Ft(discar)m(ds)45 b(any)g(such)g
(values)g(and)g(r)m(eturns)g(nothing.)614 6099 y Fp(Ensure-Atomicity)
189 b Ft(and)e Fp(ensure-atomicity!)483 b Ft(ar)m(e)186
b(macr)m(o)g(versions)332 6325 y(of)400 b Fp(call-ensuring-atomicity)i
Ft(and)d Fp(call-ensuring-atomicity!)p Ft(:)332 6551
y Fp(\(ensure-atomicity)111 b Fs(exp)d Fp(...\))249 b
Ft(expands)110 b(into)g Fp(\(call-ensuring-atomicity)332
6777 y(\(lambda)g(\(\))f Fs(exp)g Fp(...\)\))p Ft(;)378
b(likewise)266 b(for)h Fp(ensure-atomicity!)721 b Ft(and)332
7002 y Fp(call-ensuring-atomicity!)p Ft(.)368 7334 y
Fl(\017)91 b Fp(\(provisional-car)i Fs(pair)p Fp(\))d
Fl(!)g Fs(value)368 7560 y Fl(\017)h Fp(\(provisional-cdr)i
Fs(pair)p Fp(\))d Fl(!)g Fs(value)368 7785 y Fl(\017)h
Fp(\(provisional-set-car!)i Fs(pair)d(value)p Fp(\))368
8011 y Fl(\017)h Fp(\(provisional-set-cdr!)i Fs(pair)d(value)p
Fp(\))368 8237 y Fl(\017)h Fp(\(provisional-cell-ref)i
Fs(cell)p Fp(\))d Fl(!)h Fs(value)368 8463 y Fl(\017)g
Fp(\(provisional-cell-set!)i Fs(cell)d(value)p Fp(\))368
8689 y Fl(\017)h Fp(\(provisional-vector-ref)i Fs(vector)d(i)p
Fp(\))g Fl(!)h Fs(value)368 8915 y Fl(\017)g Fp
(\(provisional-vector-set!)i Fs(vector)d(i)g(value)p
Fp(\))368 9140 y Fl(\017)h Fp(\(provisional-string-ref)i
Fs(vector)d(i)p Fp(\))g Fl(!)h Fs(char)368 9366 y Fl(\017)g
Fp(\(provisional-string-set!)i Fs(vector)d(i)g(char)p
Fp(\))368 9592 y Fl(\017)h Fp(\(provisional-byte-vector-ref)j
Fs(vector)89 b(i)p Fp(\))i Fl(!)g Fs(k)368 9818 y Fl(\017)g
Fp(\(provisional-byte-vector-set!)j Fs(vector)89 b(i)i(k)q
Fp(\))332 10149 y Ft(These)48 b(ar)m(e)f(all)g(logging)g(versions)g(of)
g(their)g(Scheme)g(counterparts.)62 b(Reads)48 b(ar)m(e)f(checked)g
(when)332 10375 y(the)j(curr)m(ent)f(pr)m(oposal)i(is)f(committed)g
(and)f(writes)h(ar)m(e)g(delayed)g(until)g(the)g(commit)f(succeeds.)332
10601 y(If)c(the)h(curr)m(ent)e(pr)m(oposal)i(is)g Fp(#f)f
Ft(these)h(perform)f(exactly)g(as)h(their)f(Scheme)g(counterparts.)614
10827 y(The)81 b(following)e(implementation)g(of)h(a)g(simple)g
(counter)f(may)h(not)g(function)f(pr)m(operly)332 11053
y(when)45 b(used)g(by)g(multiple)g(thr)m(eads.)663 11417
y Fp(\(define)110 b(\(make-counter\))881 11643 y(\(let)f(\(\(value)h
(0\)\))3661 12141 y Ft(68)p eop end
%%Page: 69 77
TeXDict begin 69 76 bop 933 1146 a Fp(\(lambda)110 b(\(\))1151
1372 y(\(set!)g(value)f(\(+)h(value)f(1\)\))1151 1598
y(value\)\)\))448 1974 y Ft(Her)m(e)54 b(is)f(the)h(same)f(pr)m(ocedur)
m(e)g(using)f(a)i(pr)m(oposal)g(to)g(ensur)m(e)e(that)i(each)f(incr)m
(ement)f(oper)m(-)166 2199 y(ation)f(happens)g(atomically)-20
b(.)73 b(The)51 b(value)f(of)h(the)g(counter)g(is)g(kept)g(in)g(a)g
(cell)f(\(see)h(section)g(5.7)g(to)166 2425 y(allow)45
b(the)h(use)f(of)g(logging)h(operations.)497 2801 y Fp(\(define)109
b(\(make-counter\))715 3027 y(\(let)g(\(\(value)h(\(make-cell)g
(0\)\)\))933 3253 y(\(lambda)g(\(\))1151 3479 y(\(ensure-atomicity)1369
3705 y(\(lambda)g(\(\))1588 3931 y(\(let)f(\(\(v)g(\(+)h
(\(provisional-cell-ref)h(value\))2897 4157 y(1\)\)\))1806
4383 y(\(provisional-cell-set!)g(value)e(v\))1806 4609
y(v\)\)\)\)\)\))448 4985 y Ft(Because)57 b Fp(ensure-atomicity)i
Ft(cr)m(eates)e(a)g(new)g(pr)m(oposal)h(only)f(if)g(ther)m(e)g(is)h(no)
f(existing)166 5211 y(pr)m(oposal)75 b(in)f(place,)82
b(multiple)74 b(atomic)f(actions)i(can)e(be)h(mer)m(ged)g(into)h(a)f
(single)g(atomic)g(ac-)166 5437 y(tion.)g(For)51 b(example,)h(the)g
(following)e(pr)m(ocedur)m(e)g(incr)m(ements)g(an)h(arbitrary)f(number)
f(of)i(coun-)166 5663 y(ters)61 b(at)g(the)g(same)f(time.)103
b(This)61 b(works)g(even)f(if)g(the)h(same)g(counter)f(appears)h
(multiple)g(times;)166 5889 y Fp(\(step-counters!)220
b(c0)109 b(c0\))46 b Ft(would)f(add)g(two)h(to)g(the)f(value)g(of)g
(counter)g Fp(c0)p Ft(.)497 6265 y Fp(\(define)109 b(\(step-counters!)i
(.)e(counters\))715 6491 y(\(ensure-atomicity)933 6717
y(\(lambda)h(\(\))1151 6943 y(\(for-each)g(\(lambda)g(\(counter\))2460
7169 y(\(counter\)\))2242 7395 y(counters\)\)\)\))497
7821 y(\(define-synchronized-record-type)i Fs(tag)c(type-name)715
8047 y Fp(\()p Fs(constructor-name)f(\002eld-tag)g Fp(...\))715
8273 y([\()46 b Fs(\002eld-tag)107 b Fp(...\)])715 8499
y Fs(pr)m(edicate-name)715 8725 y Fp(\()p Fs(\002eld-tag)g
(accessor-name)g Fp([)p Fs(modi\002er-name)p Fp(]\))715
8951 y(...\))166 9377 y Ft(This)84 b(is)f(the)g(same)g(as)h
Fp(define-record-type)g Ft(except)g(all)f(\002eld)g(r)m(eads)g(and)g
(writes)g(ar)m(e)166 9603 y(logged)62 b(in)f(the)h(curr)m(ent)e(pr)m
(oposal.)106 b(If)61 b(the)h(optional)g(list)g(of)f(\002eld)g(tags)h
(is)g(pr)m(esent)f(then)h(only)166 9828 y(those)46 b(\002elds)g(will)e
(be)i(logged.)202 10171 y Fl(\017)91 b Fp(\(call-atomically)i
Fs(thunk)q Fp(\))d Fl(!)h Fs(value\(s\))202 10397 y Fl(\017)g
Fp(\(call-atomically!)i Fs(thunk)q Fp(\))202 10623 y
Fl(\017)e Fp(\(atomically)h Fs(exp)f Fp(...\))45 b Fl(!)h
Fs(value\(s\))3162 b Ft(syntax)202 10849 y Fl(\017)91
b Fp(\(atomically!)h Fs(exp)f Fp(...\))3914 b Ft(syntax)166
11191 y Fp(Call-atomically)306 b Ft(and)e Fp(call-atomically!)835
b Ft(ar)m(e)304 b(identical)g(to)166 11417 y Fp
(call-ensuring-atomicity)43 b Ft(and)e Fp(call-ensuring-atomicity!)57
b Ft(except)41 b(that)h(they)166 11643 y(always)c(install)f(a)h(new)g
(pr)m(oposal)g(befor)m(e)f(calling)h Fp(thunk)p Ft(.)55
b(The)38 b(curr)m(ent)f(pr)m(oposal)h(is)g(saved)g(and)3495
12141 y(69)p eop end
%%Page: 70 78
TeXDict begin 70 77 bop 332 1146 a Ft(then)75 b(r)m(estor)m(ed)g(after)
g Fp(thunk)g Ft(r)m(eturns.)145 b Fp(Call-atomically)76
b Ft(and)f Fp(Call-atomically!)332 1372 y Ft(ar)m(e)41
b(useful)f(if)h Fp(thunk)h Ft(contains)g(code)f(that)h(is)f(not)h(to)g
(be)f(combined)g(with)g(any)g(other)h(operation.)614
1605 y Fp(Atomically)53 b Ft(and)e Fp(atomically!)75
b Ft(ar)m(e)51 b(macr)m(o)g(versions)g(of)g Fp(call-atomically)i
Ft(and)332 1831 y Fp(call-atomically!)p Ft(:)59 b Fp(\(atomically)110
b Fs(exp)e Fp(...\))57 b Ft(expands)46 b(into)g Fp(\(call-atomically)
332 2057 y(\(lambda)110 b(\(\))f Fs(exp)g Fp(...\)\))p
Ft(;)46 b(likewise)f(for)g Fp(atomically!)58 b Ft(and)45
b Fp(call-atomically!)p Ft(.)368 2430 y Fl(\017)91 b
Fp(\(with-new-proposal)i(\()p Fs(lose)p Fp(\))d Fs(exp)g
Fp(...\))46 b Fl(!)f Fs(value)g(.)27 b(.)g(.)1776 b Ft(syntax)614
2803 y Fp(With-new-proposal)42 b Ft(saves)e(the)h(curr)m(ent)e(pr)m
(oposal,)j(installs)f(a)f(new)g(one,)i(executes)e(the)332
3029 y(forms)48 b(in)g(the)h(body)-20 b(,)49 b(and)f(r)m(eturns)g
(whatever)g(they)h(r)m(eturns.)65 b(It)49 b(also)f(binds)g
Fs(lose)f Ft(to)i(a)g(thunk)f(r)m(e-)332 3254 y(peating)g(the)f(pr)m
(ocedur)m(e)g(of)g(installing)f(a)i(new)e(pr)m(ocedur)m(e)h(and)g(r)o
(unning)f(the)h(body)-20 b(.)62 b(T)-16 b(ypically)c(,)332
3480 y(the)46 b(body)f(will)g(call)g Fp(maybe-commit)h
Ft(and,)g(if)f(that)h(fails,)f(call)g Fs(lose)f Ft(to)i(try)g(again.)
614 3714 y(The)j(following)f(pr)m(ocedur)m(es)h(give)f(access)g(to)i
(the)f(low-level)e(pr)m(oposal)j(mechanism.)65 b(They)332
3940 y(ar)m(e)45 b(de\002ned)h(in)f(the)h Fp(low-proposals)g
Ft(str)o(uctur)m(e.)368 4346 y Fl(\017)91 b Fp(\(maybe-commit\))h
Fl(!)f Fs(boolean)368 4572 y Fl(\017)g Fp(\(make-proposal\))i
Fl(!)d Fs(pr)m(oposal)368 4798 y Fl(\017)h Fp(\(current-proposal\))i
Fl(!)e Fs(pr)m(oposal)368 5023 y Fl(\017)g Fp(\(set-current-proposal!)i
Fs(pr)m(oposal)p Fp(\))332 5430 y(Maybe-commit)59 b Ft(veri\002es)e
(that)g(any)h(r)m(eads)f(logged)h(in)f(the)h(curr)m(ent)e(pr)m(oposal)i
(ar)m(e)f(still)h(valid)332 5656 y(and,)44 b(if)f(so,)i(performs)e(any)
h(writes)f(that)h(it)g(contains.)56 b(A)44 b(logged)g(r)m(ead)f(is)h
(valid)f(if,)h(at)g(the)g(time)f(of)332 5881 y(the)f(commit,)h(the)f
(location)g(r)m(ead)g(contains)g(the)g(same)g(value)f(it)h(had)g(at)g
(the)g(time)g(of)g(the)g(original)332 6107 y(r)m(ead)j(\(note)h(that)f
(this)h(does)g(not)f(mean)g(that)h(no)f(change)g(occur)m(ed,)g(simply)g
(that)h(the)g(value)e(now)332 6333 y(is)f(the)g(same)f(as)h(the)g
(value)f(then\).)55 b Fp(Maybe-commit)44 b Ft(r)m(eturns)e
Fp(#t)h Ft(if)f(the)h(commit)f(succeeds)g(and)332 6559
y Fp(#f)k Ft(if)f(it)g(fails.)614 6792 y Fp(Make-proposal)180
b Ft(cr)m(eates)e(a)h(new)f(pr)m(oposal.)456 b Fp(Current-proposal)180
b Ft(and)332 7018 y Fp(set-current-proposal)88 b Ft(access)d(and)g(set)
i(the)f(curr)m(ent)e(thr)m(ead's)h(pr)m(oposal.)178 b(It)87
b(is)e(an)332 7244 y(err)m(or)45 b(to)h(pass)g(to)g Fp
(set-current-proposal!)58 b Ft(a)46 b(pr)m(oposal)g(that)f(is)h(alr)m
(eady)f(in)g(use.)332 7889 y Fm(6.5)238 b(Condition)58
b(variables)332 8327 y Fs(Condition)65 b(variables)e
Ft(\(de\002ned)j(in)g(the)g Fp(condvars)h Ft(str)o(uctur)m(e\))d(allow)
i(thr)m(eads)f(perform)h(con-)332 8552 y(dition)48 b(synchr)m
(onization:)59 b(It)48 b(allows)f(thr)m(eads)g(to)g(block,)h(waiting)f
(for)g(a)g(speci\002ed)g(condition\227)332 8778 y(associated)40
b(with)f(a)h(condition)f(variable\227to)g(occur)-13 b(,)40
b(and)f(other)h(thr)m(eads)f(to)h(wake)g(up)f(the)h(wait-)332
9004 y(ing)45 b(thr)m(eads)h(when)e(the)i(condition)g(is)f
(ful\002lled.)614 9238 y(Note)54 b(that,)g(in)f(Scheme)f(48,)i
(condition)f(variables)e(work)h(in)h(conjunction)e(with)h(pr)m
(oposals,)332 9463 y(not)37 b(with)f(mutex)g(locks)g(or)h(semaphor)m
(es,)h(as)f(in)f(most)h(other)f(implementations)h(of)f(this)g(concept.)
368 9836 y Fl(\017)91 b Fp(\(make-condvar\))h Fl(!)f
Fs(condvar)368 10062 y Fl(\017)g Fp(\(make-condvar)h
Fs(id)p Fp(\))f Fl(!)g Fs(condvar)368 10288 y Fl(\017)g
Fp(\(condvar?)103 b Fs(thing)p Fp(\))90 b Fl(!)h Fs(boolean)368
10514 y Fl(\017)g Fp(\(set-condvar-has-value?!)i Fs(condvar)d(boolean)p
Fp(\))368 10740 y Fl(\017)h Fp(\(condvar-has-value?)104
b Fs(condvar)p Fp(\))90 b Fl(!)h Fs(boolean)368 10966
y Fl(\017)g Fp(\(set-condvar-value!)i Fs(condvar)d(value)p
Fp(\))368 11191 y Fl(\017)h Fp(\(condvar-value)h Fs(condvar)p
Fp(\))f Fl(!)f Fs(value)368 11417 y Fl(\017)h Fp
(\(maybe-commit-and-wait-for-condvar)j Fs(condvar)p Fp(\))c
Fl(!)h Fs(boolean)368 11643 y Fl(\017)g Fp
(\(maybe-commit-and-set-condvar!)105 b Fs(condvar)90
b(value)p Fp(\))g Fl(!)h Fs(boolean)3661 12141 y Ft(70)p
eop end
%%Page: 71 79
TeXDict begin 71 78 bop 166 1146 a Fp(Make-condvar)65
b Ft(cr)m(eates)e(a)h(condition)f(variable.)111 b(\(The)63
b(optional)h Fs(id)f Ft(ar)m(gument)g(is)h(only)f(for)166
1372 y(debugging)73 b(purposes;)89 b(the)74 b(discloser)g(for)f
(condition)h(variables)f(prints)h(it)g(out)g(if)f(pr)m(esent.\))166
1597 y Fp(Condvar?)57 b Ft(is)46 b(the)f(pr)m(edicate)h(for)f
(condition)g(variables.)448 1830 y(Each)37 b(condition)h(variable)e
(has)h(an)g(associated)g(value)g(and)g(a)g(\003ag)g Fp(has-value?)55
b Ft(signalling)166 2055 y(if)44 b(the)i(condition)f(has)g(alr)m(eady)f
(occur)m(ed.)56 b(The)45 b(accessor)g(for)f(\003ag)h(is)g
Fp(condvar-has-value?)p Ft(;)166 2281 y Fp(set-condvar-has-value?!)207
b Ft(sets)95 b(it.)205 b(Both)96 b(ar)m(e)e(pr)m(ovisional)g
(operations)i(and)f(go)166 2507 y(thr)m(ough)62 b(the)i(curr)m(ent)d
(pr)m(oposal.)110 b Fp(Set-condvar-value!)h Ft(sets)63
b(the)h(value)e(of)h(the)g(condi-)166 2733 y(tion)46
b(variable)e(\(pr)m(ovisionally\),)h(and)g Fp(condvar-value)i
Ft(extracts)e(it.)448 2965 y Fp(Maybe-commit-and-wait-for-condvar)186
b Ft(attempts)d(to)g(commit)e(the)i(cur)m(-)166 3191
y(r)m(ent)119 b(pr)m(oposal.)280 b(If)119 b(the)h(commit)f(succeeds,)
138 b(it)119 b(suspends)h(the)g(curr)m(ent)e(thr)m(ead)h(and)166
3417 y(r)m(egisters)144 b(it)h(with)f(the)h Fs(condvar)e
Ft(condition)i(variable.)352 b(Upon)145 b(waking)f(up)g(again)166
3642 y Fp(maybe-commit-and-wait-for-condvar)170 b Ft(r)m(eturns)c
Fp(#t)p Ft(,)197 b(If)167 b(the)f(commit)g(fails,)166
3868 y Fp(maybe-commit-and-set-condvar)48 b Ft(r)m(eturns)d
Fp(#f)p Ft(.)448 4100 y Fp(Maybe-commit-and-set-condvar!)160
b Ft(sets)79 b(the)g(value)f(of)h(the)g Fs(condvar)f
Ft(condition)166 4326 y(variable)57 b(to)i Fs(value)p
Ft(,)j(\(pr)m(ovisionally\))57 b(sets)i(the)g Fp(has-value?)96
b Ft(\003ag)58 b(to)h Fp(#t)p Ft(,)k(and)58 b(then)g(attempt)166
4552 y(to)69 b(commit)e(the)h(curr)m(ent)g(pr)m(oposal.)125
b(Upon)69 b(success,)74 b(it)68 b(wakes)g(up)g(all)g(suspended)g(thr)m
(eads)166 4778 y(r)m(egister)m(ed)45 b(with)g Fs(condvar)g
Ft(and)g(r)m(eturns)g Fp(#t)p Ft(,)h(otherwise,)g(it)g(r)m(eturns)e
Fp(#f)p Ft(.)166 5414 y Fm(6.6)238 b(Mutual)59 b(exclusion)166
5849 y Ft(Scheme)g(48)g(also)h(has)f(mor)m(e)g(traditional)g
(mutual-exclusion)e(synchr)m(onization)i(abstractions,)166
6075 y(speci\002cally)69 b(mutex)h(locks)g(and)f(placeholders.)130
b(Note)71 b(that)f(typically)g(synchr)m(onization)e(via)166
6301 y(optimistic)42 b(concurr)m(ency)f(is)h(usually)f(pr)m(eferable:)
54 b(Mutual)42 b(exclusion)g(often)g(puts)g(the)h(r)o(unning)166
6526 y(pr)m(ogram)65 b(into)g(an)g(inconsistent)g(state)h(for)e(the)i
(time)f(of)g(the)g(inclusion,)k(which)64 b(has)h(adverse)166
6752 y(ef)m(fects)45 b(on)g(modularity)g(and)g(interr)o(uptibility)-20
b(.)166 7301 y Fg(6.6.1)198 b(Locks)166 7668 y Ft(The)46
b Fp(locks)g Ft(str)o(uctur)m(e)e(contains)h(bindings)g(that)h
(implement)e(standar)m(d)i(mutex)e(locks:)202 8068 y
Fl(\017)91 b Fp(\(make-lock\))h Fl(!)f Fs(lock)202 8294
y Fl(\017)g Fp(\(lock?)103 b Fs(thing)p Fp(\))90 b Fl(!)g
Fs(boolean)202 8520 y Fl(\017)h Fp(\(obtain-lock)h Fs(lock)q
Fp(\))202 8746 y Fl(\017)f Fp(\(maybe-obtain-lock)i Fs(lock)q
Fp(\))d Fl(!)g Fs(boolean)202 8971 y Fl(\017)h Fp(\(release-lock)h
Fs(lock)q Fp(\))166 9372 y(Make-lock)46 b Ft(cr)m(eates)f(a)h(lock)f
(in)g(the)h(\223r)m(eleased\224)f(state.)58 b Fp(Lock?)e
Ft(is)46 b(the)g(pr)m(edicate)f(for)g(locks.)448 9604
y Fp(Obtain-lock)55 b Ft(atomically)f(checks)f(if)g Fs(lock)g
Ft(is)h(in)g(the)g(\223r)m(eleased\224)g(state.)83 b(If)53
b(it)h(is,)j(the)d(lock)166 9830 y(is)44 b(put)h(into)f(the)h
(\223obtained\224)f(state,)i(and)e Fp(obtain-lock)h Ft(r)m(eturns)f
(immediately)-20 b(.)55 b(If)44 b(the)h(lock)f(is)166
10056 y(in)50 b(the)g(\223obtained\224)f(state,)j(the)e(curr)m(ent)f
(thr)m(ead)h(is)g(suspended)g(and)f(r)m(egister)m(ed)h(with)g(the)g
(lock.)166 10282 y Fp(Maybe-obtain-lock)p Ft(,)d(like)e
Fp(obtain-lock)p Ft(,)i(checks)d(the)h(state)h(of)f Fs(lock)p
Ft(:)55 b(if)45 b(it)g(is)g(\223r)m(eleased,\224)166
10508 y(the)68 b(lock)g(is)f(put)h(into)g(the)g(\223obtained\224)g
(state,)74 b(if)67 b(it)h(is)g(\223obtained,\224)73 b
Fp(maybe-obtain-lock)166 10733 y Ft(r)m(eturns)65 b(immediately)-20
b(.)116 b Fp(Maybe-obtain-lock)67 b Ft(r)m(eturns)d Fp(#t)i
Ft(if)f(it)h(was)f(able)g(to)h(obtain)f(the)166 10959
y(lock,)46 b(and)f Fp(#f)h Ft(otherwise.)448 11191 y
Fp(Release-lock)108 b Ft(does)f(nothing)g(if)f Fs(lock)f
Ft(is)i(in)f(the)h(\223r)m(eleased\224)f(state.)241 b(If)106
b(it)h(is)f(in)166 11417 y(the)78 b(\223obtained\224)g(state,)88
b Fp(release-lock)79 b Ft(causes)e(one)i(of)f(the)g(thr)m(eads)g
(suspended)g(on)g(an)166 11643 y Fp(obtain-lock)57 b
Ft(lock)f(operation)h(to)g(continue)e(execution.)89 b(If)55
b(that)i(thr)m(ead)f(is)g(the)g(last)g(thr)m(ead)3495
12141 y(71)p eop end
%%Page: 72 80
TeXDict begin 72 79 bop 332 1146 a Ft(r)m(egister)m(ed)62
b(with)f(the)h(lock,)k(the)c(lock)g(is)g(transferr)m(ed)e(to)j(the)f
(\223r)m(eleased\224)f(state.)106 b(In)62 b(any)g(case,)332
1372 y Fp(release-lock)47 b Ft(r)m(eturns)d(immediately)-20
b(.)332 1911 y Fg(6.6.2)198 b(Placeholders)332 2274 y
Ft(The)56 b Fp(placeholders)h Ft(str)o(uctur)m(e)d(contains)i(bindings)
f(for)g Fs(placeholders)p Ft(\227thr)m(ead-safe,)g(write-)332
2500 y(once)45 b(variables,)g(akin)g(to)h(ID-90)f(I-str)o(uctur)m(es)f
(or)i(CML)f(I-variables.)614 2731 y(The)71 b(typical)f(scenario)g(for)g
(placeholders)g(is)h(that,)77 b(say)-20 b(,)77 b(a)70
b(thr)m(ead)g(A)g(computes)h(a)f(value)332 2956 y(needed)51
b(by)g(another)g(thr)m(ead)g(B)g(at)g(some)h(unspeci\002ed)e(time.)74
b(Both)51 b(thr)m(eads)g(shar)m(e)g(access)g(to)g(a)332
3182 y(placeholder;)h(when)d(A)i(has)e(computed)h(the)g(value,)g(it)g
(places)g(it)g(into)g(the)f(placeholder)-13 b(.)70 b(When)332
3408 y(B)46 b(needs)f(the)h(value,)f(it)h(extracts)f(it)h(fr)m(om)e
(placeholder)-13 b(,)45 b(blocking)g(if)g(necessary)-20
b(.)368 3803 y Fl(\017)91 b Fp(\(make-placeholder\))i
Fl(!)e Fs(placeholder)368 4029 y Fl(\017)g Fp(\(make-placeholder)i
Fs(id)p Fp(\))d Fl(!)h Fs(placeholder)368 4254 y Fl(\017)g
Fp(\(placeholder?)103 b Fs(thing)p Fp(\))90 b Fl(!)h
Fs(boolean)368 4480 y Fl(\017)g Fp(\(placeholder-set!)i
Fs(placeholder)88 b(value)p Fp(\))368 4706 y Fl(\017)j
Fp(\(placeholder-value)i Fs(placeholder)p Fp(\))88 b
Fl(!)j Fs(value)332 5101 y Fp(Make-placeholder)78 b Ft(cr)m(eates)e(an)
g(empty)h(placeholder)-13 b(.)149 b(\(The)76 b(optional)h
Fs(id)f Ft(ar)m(gument)f(is)332 5326 y(only)58 b(for)g(debugging)f
(purposes;)66 b(the)58 b(discloser)g(for)g(placeholders)g(prints)g(it)g
(out)g(if)g(pr)m(esent.\))332 5552 y Fp(Placeholder?)g
Ft(is)45 b(the)h(pr)m(edicate)f(for)g(placeholders.)614
5783 y Fp(Placeholder-set!)56 b Ft(places)37 b(a)h(value)f(into)g(a)h
(placeholder)-13 b(.)54 b(Doing)37 b(this)h(mor)m(e)f(than)g(once)332
6009 y(signals)55 b(an)h(err)m(or)-13 b(.)86 b Fp(Placeholder-value)57
b Ft(extracts)f(the)g(value)f(fr)m(om)f(the)i(placeholder)f(and)332
6234 y(r)m(eturns)40 b(it.)55 b(If)40 b(the)g(placeholder)h(is)f(empty)
-20 b(,)42 b(it)e(blocks)g(the)h(curr)m(ent)e(thr)m(ead)h(until)g(it)g
(becomes)g(full.)332 6861 y Fm(6.7)238 b(W)-18 b(riting)59
b(custom)g(synchronization)g(abstractions)332 7293 y
Ft(The)48 b(bindings)e(explained)h(in)g(this)g(section)h(ar)m(e)f(part)
g(of)g(the)g Fp(threads-internal)i Ft(str)o(uctur)m(e.)332
7519 y(They)g(ar)m(e)f(concerned)f(with)h(suspending)g(thr)m(eads)g
(and)g(making)g(them)g(r)o(unnable)e(again)i(upon)332
7745 y(some)e(later)f(event.)614 7975 y(T)-16 b(ypically)c(,)41
b(a)f(suspended)g(thr)m(ead)f(needs)h(to)g(be)f(r)m(ecor)m(ded)g(in)h
(a)f(queue)g(somewher)m(e)g(for)g(later)332 8201 y(waking-up.)90
b(T)-17 b(o)58 b(allow)e(a)h(thr)m(ead)f(to)i(be)e(r)m(ecor)m(ded)g(in)
h(multiple)f(queues)h(\(say)-20 b(,)59 b(when)d(it)h(waits)332
8427 y(for)42 b(one)g(of)f(a)h(number)e(of)i(events\),)h(such)e
Fs(thr)m(ead)f(queues)h Ft(ar)m(e)h(or)m(dinary)f(queues)g(containing)g
(cells)332 8653 y(that,)48 b(in)f(turn,)g(contain)g(the)g(thr)m(ead)g
(objects)g(themselves.)61 b(Each)47 b(thr)m(ead)f(has)h(at)g(most)h
(one)f(such)332 8879 y(cell)69 b(associated)g(with)g(it)g(which)f(is)h
(shar)m(ed)g(among)f(all)h(queues)g(\(or)f(other)i(data)f(str)o(uctur)m
(es\))332 9104 y(holding)45 b(on)h(to)g(the)g(suspended)f(thr)m(ead.)57
b(The)46 b(cell)f(is)g(clear)m(ed)g(when)g(the)g(thr)m(ead)h(is)f
(woken)g(up.)368 9499 y Fl(\017)91 b Fp(\(thread-queue-empty?)104
b Fs(thr)m(ead-queue)p Fp(\))89 b Fl(!)h Fs(boolean)368
9725 y Fl(\017)h Fp(\(maybe-dequeue-thread!)104 b Fs(thr)m(ead-queue)p
Fp(\))89 b Fl(!)h Fs(boolean)332 10119 y Fp(Thread-queue-empty?)58
b Ft(atomically)45 b(checks)g(whether)g(the)h Fs(thr)m(ead-queue)d
Ft(thr)m(ead)i(queue)g(is)332 10345 y(empty)-20 b(,)47
b(i.e.,)i(if)d(it)h(does)g(not)g(contain)f(non-empty)g(cells.)60
b Fp(Maybe-dequeue-thread!)i Ft(pr)m(ovi-)332 10571 y(sionally)37
b(dequeues)f(a)g(thr)m(ead)h(fr)m(om)e Fs(thr)m(ead-queue)f
Ft(if)i(it)h(contains)g(one.)54 b(It)37 b(r)m(eturns)f(the)h(dequeued)
332 10797 y(thr)m(ead)45 b(or)h Fp(#f)f Ft(if)g(the)h(queue)f(is)g
(empty)-20 b(.)368 11191 y Fl(\017)91 b Fp(\(maybe-commit-and-block)i
Fs(cell)p Fp(\))d Fl(!)h Fs(boolean)368 11417 y Fl(\017)g
Fp(\(maybe-commit-and-block-on-queue)j Fs(thr)m(ead-queue)p
Fp(\))89 b Fl(!)h Fs(boolean)368 11643 y Fl(\017)h Fp
(\(maybe-commit-and-make-ready)j Fs(thr)m(ead-or-queue)p
Fp(\))87 b Fl(!)k Fs(boolean)3661 12141 y Ft(72)p eop
end
%%Page: 73 81
TeXDict begin 73 80 bop 166 1146 a Fp(Maybe-commit-and-block)67
b Ft(attempts)e(to)h(commit)e(the)h(curr)m(ent)f(pr)m(oposal.)115
b(If)65 b(this)g(suc-)166 1372 y(ceeds,)91 b(the)82 b(curr)m(ent)f(thr)
m(ead)g(is)h(blocked,)91 b(the)82 b(thr)m(ead's)f(cell)g(is)h(set)g(to)
g Fs(cell)p Ft(,)90 b(and)81 b Fp(#t)h Ft(is)g(r)m(e-)166
1597 y(turned.)91 b(Otherwise,)60 b Fp(#f)d Ft(is)g(r)m(eturned.)90
b Fp(Maybe-commit-and-block-on-queue)60 b Ft(is)d(like)166
1823 y Fp(maybe-commit-and-block)p Ft(,)75 b(excepts)68
b(that)f(it)g(cr)m(eates)g(a)g(fr)m(esh)f(cell)h(for)g(the)g(thr)m(ead)
g(and)166 2049 y(enqueues)45 b(it)g(in)h Fs(thr)m(ead-queue)d
Ft(if)i(the)g(commit)g(succeeds.)448 2275 y Fp
(Maybe-commit-and-make-ready)90 b Ft(accepts)d(either)g(a)f(thr)m(ead)h
(object)f(or)h(a)g(thr)m(ead)166 2501 y(queue)69 b(as)g(an)g(ar)m
(gument.)127 b(In)69 b(either)g(case,)75 b Fp
(maybe-commit-and-make-ready)d Ft(tries)d(to)166 2726
y(commit)46 b(the)h(curr)m(ent)f(pr)m(oposal.)62 b(If)46
b(that)h(succeeds,)h(it)f Fp(maybe-commit-and-make-ready)166
2952 y Ft(makes)86 b(its)h(ar)m(gument)f(r)o(unnable:)137
b(if)86 b Fs(thr)m(ead-or-queue)d Ft(is)j(a)h(thr)m(ead,)97
b(that)87 b(thr)m(ead)f(is)g(made)166 3178 y(r)o(unnable,)75
b(if)69 b(it)h(is)g(a)g(thr)m(ead)f(queue,)76 b(all)69
b(thr)m(eads)h(on)g(the)g(queue)f(ar)m(e)h(made)f(r)o(unnable.)128
b(\(In)166 3404 y(the)54 b(latter)g(case,)h(none)f(of)f(the)h(thr)m
(eads)f(actually)g(r)o(uns)f(until)h(all)h(have)f(been)g(made)g(r)o
(unnable.\))166 3630 y Fp(Marybe-commit-and-make-ready)48
b Ft(r)m(eturns)d Fp(#t)g Ft(if)g(it)h(succeeded,)f(and)h
Fp(#f)f Ft(otherwise.)3495 12141 y(73)p eop end
%%Page: 74 82
TeXDict begin 74 81 bop 332 2391 a Fo(Chapter)87 b(7)332
3221 y Fr(Mixing)102 b(Scheme)i(48)f(and)g(C)332 4144
y Ft(This)91 b(chapter)g(describes)g(an)f(interface)h(for)f(calling)g
(C)h(functions)f(fr)m(om)g(Scheme,)103 b(calling)332
4370 y(Scheme)37 b(functions)f(fr)m(om)g(C,)i(and)f(allocating)g
(storage)h(in)e(the)i(Scheme)f(heap..)54 b(Scheme)37
b(48)g(man-)332 4596 y(ages)j(stub)f(functions)f(in)h(C)h(that)f
(negotiate)h(between)f(the)h(calling)f(conventions)g(of)g(Scheme)g(and)
332 4822 y(C)53 b(and)g(the)g(memory)g(allocation)g(policies)g(of)g
(both)g(worlds.)80 b(No)53 b(stub)g(generator)g(is)g(available)332
5048 y(yet,)46 b(but)f(writing)g(stubs)g(is)h(a)f(straightforwar)m(d)g
(task.)332 5641 y Fm(7.1)238 b(A)-17 b(vailable)58 b(facilities)332
6063 y Ft(The)46 b(following)f(facilities)f(ar)m(e)h(available)g(for)g
(interfacing)f(between)h(Scheme)g(48)h(and)f(C:)605 6420
y Fl(\017)91 b Ft(Scheme)45 b(code)g(can)g(call)g(C)h(functions.)605
6788 y Fl(\017)91 b Ft(The)37 b(external)f(interface)g(pr)m(ovides)h
(full)f(intr)m(ospection)h(for)g(all)f(Scheme)h(objects.)53
b(External)787 7014 y(code)45 b(may)g(inspect,)h(modify)-20
b(,)46 b(and)f(allocate)g(Scheme)g(objects)g(arbitrarily)-20
b(.)605 7382 y Fl(\017)91 b Ft(External)45 b(code)g(may)g(raise)h
(exceptions)g(back)e(to)i(Scheme)f(48)h(to)g(signal)f(err)m(ors.)605
7750 y Fl(\017)91 b Ft(External)34 b(code)h(may)f(call)g(back)g(into)h
(Scheme.)53 b(Scheme)35 b(48)f(corr)m(ectly)g(unr)m(olls)g(the)h(pr)m
(ocess)787 7975 y(stack)45 b(on)h(non-local)e(exits.)605
8343 y Fl(\017)91 b Ft(External)55 b(modules)g(may)f(r)m(egister)i
(bindings)e(of)h(names)g(to)h(values)f(with)g(a)g(central)g(r)m(eg-)787
8569 y(istry)38 b(accessible)f(fr)m(om)g(Scheme.)54 b(Conversely)-20
b(,)39 b(Scheme)f(code)g(can)g(r)m(egister)g(shar)m(ed)f(bind-)787
8795 y(ings)45 b(for)g(access)g(by)g(C)h(code.)332 9301
y Fg(7.1.1)198 b(Scheme)49 b(structures)332 9654 y Ft(The)67
b(str)o(uctur)m(e)e Fp(external-calls)i Ft(has)g(most)f(of)g(the)h
(Scheme)f(functions)f(described)h(her)m(e.)332 9880 y(The)37
b(others)h(ar)m(e)e(in)h Fp(dynamic-externals)p Ft(,)j(which)c(has)h
(the)g(functions)f(for)g(dynamic)g(loading)332 10106
y(and)g(name)f(lookup)h(fr)m(om)f(Section)h(7.5,)76 b(and)35
b Fp(shared-bindings)p Ft(,)40 b(which)35 b(has)g(the)h(additional)332
10332 y(shar)m(ed-binding)44 b(functions)g(described)h(in)g(Section)h
(7.2.3.)332 10838 y Fg(7.1.2)198 b(C)50 b(naming)f(conventions)332
11191 y Ft(The)i(names)f(of)g(all)h(of)f(Scheme)g(48's)g(visible)g(C)h
(bindings)e(begin)h(with)h(`)p Fp(s48)p 5776 11191 55
7 v 65 w Ft(')f(\(for)g(pr)m(ocedur)m(es)332 11417 y(and)i(variables\))
f(or)i(`)p Fp(S48)p 2145 11417 V 65 w Ft(')f(\(for)g(macr)m(os\).)77
b(Whenever)52 b(a)g(C)h(name)f(is)g(derived)g(fr)m(om)g(a)g(Scheme)332
11643 y(identi\002er)-13 b(,)57 b(we)d(r)m(eplace)f(`)p
Fp(-)p Ft(')h(with)g(`)p 2833 11643 V 65 w(')g(and)g(convert)g(letters)
g(to)h(lower)m(case)f(for)g(pr)m(ocedur)m(es)f(and)3661
12141 y(74)p eop end
%%Page: 75 83
TeXDict begin 75 82 bop 166 1146 a Ft(upper)m(case)57
b(for)g(macr)m(os.)91 b(A)58 b(\002nal)f(`)p Fp(?)p Ft(')91
b(converted)57 b(to)h(`)p 4104 1146 55 7 v 65 w Fp(p)p
Ft(')f(\(`)p 4498 1146 V 65 w Fp(P)p Ft(')g(in)g(C)g(macr)m(o)f
(names\).)92 b(A)57 b(\002nal)166 1372 y(`)p Fp(!)p Ft(')100
b(is)61 b(dr)m(opped.)102 b(Thus)60 b(the)g(C)h(macr)m(o)e(for)h
(Scheme's)g Fp(pair?)101 b Ft(is)60 b Fp(S48)p 5307 1372
V 66 w(PAIR)p 5809 1372 V 66 w(P)g Ft(and)g(the)h(one)166
1597 y(for)43 b Fp(set-car!)56 b Ft(is)43 b Fp(S48)p
1880 1597 V 66 w(SET)p 2273 1597 V 66 w(CAR)p Ft(.)g(Pr)m(ocedur)m(es)f
(and)h(macr)m(os)f(that)i(do)f(not)h(check)e(the)h(types)h(of)166
1823 y(their)h(ar)m(guments)g(have)g(`)p Fp(unsafe)p
Ft(')g(in)g(their)g(names.)448 2049 y(All)51 b(of)f(the)h(C)f
(functions)f(and)i(macr)m(os)e(described)h(have)g(pr)m(ototypes)i(or)e
(de\002nitions)h(in)f(the)166 2275 y(\002le)45 b Fp(c/scheme48.h)p
Ft(.)58 b(The)45 b(C)g(type)h(for)f(Scheme)g(values)f(is)h(de\002ned)g
(ther)m(e)g(to)h(be)e Fp(s48)p 6360 2275 V 66 w(value)p
Ft(.)166 2779 y Fg(7.1.3)198 b(Garbage)48 b(collection)166
3133 y Ft(Scheme)58 b(48)g(uses)g(a)g(copying)g(garbage)g(collector)-13
b(.)94 b(The)59 b(collector)f(must)g(be)g(able)f(to)i(locate)f(all)166
3359 y(r)m(efer)m(ences)44 b(to)h(objects)g(allocated)g(in)g(the)g
(Scheme)g(48)g(heap)g(in)f(or)m(der)h(to)h(ensur)m(e)e(that)h(storage)h
(is)166 3584 y(not)d(r)m(eclaimed)e(pr)m(ematur)m(ely)h(and)g(to)h
(update)g(r)m(efer)m(ences)e(to)i(objects)f(moved)g(by)g(the)h
(collector)-13 b(.)166 3810 y(The)38 b(garbage)f(collector)h(may)f(r)o
(un)g(whenever)g(an)g(object)g(is)h(allocated)g(in)f(the)h(heap.)55
b(C)37 b(variables)166 4036 y(whose)64 b(values)g(ar)m(e)f(Scheme)h(48)
g(objects)g(and)g(which)f(ar)m(e)h(live)f(acr)m(oss)h(heap)g
(allocation)h(calls)166 4262 y(need)56 b(to)h(be)e(r)m(egister)m(ed)h
(with)g(the)g(garbage)f(collectorgarbage)h(collector)-13
b(.)87 b(See)57 b(section)f(7.9)g(for)166 4488 y(mor)m(e)45
b(information.)166 5080 y Fm(7.2)238 b(Shared)59 b(bindings)166
5502 y Ft(Shar)m(ed)f(bindings)f(ar)m(e)h(the)g(means)g(by)g(which)e
(named)i(values)f(ar)m(e)h(shar)m(ed)g(between)f(Scheme)166
5727 y(code)64 b(and)g(C)f(code.)113 b(Ther)m(e)64 b(ar)m(e)f(two)h
(separate)g(tables)g(of)g(shar)m(ed)f(bindings,)68 b(one)c(for)g
(values)166 5953 y(de\002ned)47 b(in)f(Scheme)g(and)g(accessed)g(fr)m
(om)f(C)i(and)f(the)g(other)h(for)f(values)f(going)i(the)g(other)f(way)
-20 b(.)166 6179 y(Shar)m(ed)48 b(bindings)g(actually)g(bind)g(names)g
(to)h(cells,)h(to)f(allow)f(a)g(name)g(to)h(be)f(looked)i(up)e(befor)m
(e)166 6405 y(it)41 b(has)f(been)g(assigned.)55 b(This)41
b(is)f(necessary)g(because)g(C)g(initialization)g(code)h(may)f(be)g(r)o
(un)f(befor)m(e)166 6631 y(or)k(after)f(the)h(corr)m(esponding)g
(Scheme)f(code,)i(depending)f(on)g(whether)f(the)h(Scheme)g(code)g(is)f
(in)166 6857 y(the)k(r)m(esumed)e(image)h(or)h(is)f(r)o(un)f(in)i(the)f
(curr)m(ent)g(session.)166 7361 y Fg(7.2.1)198 b(Exporting)48
b(Scheme)h(values)h(to)g(C)202 7715 y Fl(\017)91 b Fp
(\(define-exported-binding)i Fs(name)e(value)p Fp(\))f
Fl(!)h Fs(shar)m(ed-binding)202 8031 y Fl(\017)g Fp(s48)p
722 8031 V 66 w(value)g(s48)p 1751 8031 V 66 w(get)p
2144 8031 V 66 w(imported)p 3082 8031 V 66 w(binding\(char)h(*name\))
202 8256 y Fl(\017)f Fp(s48)p 722 8256 V 66 w(value)g(S48)p
1751 8256 V 66 w(SHARED)p 2471 8256 V 66 w(BINDING)p
3300 8256 V 66 w(REF\(s48)p 4129 8256 V 66 w(value)h(shared)p
5486 8256 V 66 w(binding\))166 8572 y(Define-exported-binding)51
b Ft(makes)e Fs(value)e Ft(available)h(to)h(C)g(code)g(under)f(as)h
Fs(name)g Ft(which)166 8798 y(must)97 b(be)f(a)h Fs(string)p
Ft(,)109 b(cr)m(eating)96 b(a)h(new)g(shar)m(ed)f(binding)g(if)h
(necessary)-20 b(.)211 b(The)97 b(C)g(function)166 9024
y Fp(s48)p 504 9024 V 66 w(get)p 897 9024 V 65 w(imported)p
1834 9024 V 67 w(binding)72 b Ft(r)m(eturns)g(the)g(shar)m(ed)g
(binding)f(de\002ned)h(for)g Fp(name)p Ft(,)79 b(again)166
9250 y(cr)m(eating)85 b(it)h(if)f(necessary)-20 b(.)177
b(The)86 b(C)g(macr)m(o)f Fp(S48)p 3805 9250 V 66 w(SHARED)p
4525 9250 V 66 w(BINDING)p 5354 9250 V 66 w(REF)h Ft(der)m(efer)m
(ences)e(a)166 9476 y(shar)m(ed)45 b(binding,)g(r)m(eturning)g(its)g
(curr)m(ent)g(value.)166 9980 y Fg(7.2.2)198 b(Exporting)48
b(C)i(values)f(to)h(Scheme)202 10334 y Fl(\017)91 b Fp(void)g(s48)p
1249 10334 V 66 w(define)p 1969 10334 V 66 w(exported)p
2907 10334 V 66 w(binding\(char)h(*name,)g(s48)p 5446
10334 V 66 w(value)f(v\))202 10650 y Fl(\017)g Fp
(\(lookup-imported-binding)i Fs(string)p Fp(\))d Fl(!)h
Fs(shar)m(ed-binding)202 10875 y Fl(\017)g Fp(\(shared-binding-ref)i
Fs(shar)m(ed-binding)p Fp(\))88 b Fl(!)j Fs(value)166
11191 y Ft(These)64 b(ar)m(e)f(used)h(to)g(de\002ne)g(shar)m(ed)f
(bindings)g(fr)m(om)g(C)g(and)g(to)i(access)e(them)g(fr)m(om)g(Scheme.)
166 11417 y(Again,)49 b(if)e(a)h(name)f(is)h(looked)h(up)f(befor)m(e)f
(it)h(has)f(been)h(de\002ned,)h(a)f(new)f(binding)g(is)h(cr)m(eated)f
(for)166 11643 y(it.)3495 12141 y(75)p eop end
%%Page: 76 84
TeXDict begin 76 83 bop 614 1146 a Ft(The)36 b(common)f(case)h(of)f
(exporting)h(a)g(C)f(function)g(to)h(Scheme)g(can)f(be)g(done)h(using)f
(the)h(macr)m(o)332 1372 y Fp(S48)p 670 1372 55 7 v 66
w(EXPORT)p 1390 1372 V 66 w(FUNCTION\()p Fs(name)p Fp(\))p
Ft(.)58 b(This)45 b(expands)h(into)663 1845 y Fp(s48)p
1001 1845 V 66 w(define)p 1721 1845 V 66 w(exported)p
2659 1845 V 66 w(binding\(")p Fs(name)p Fp(",)4045 2091
y(s48)p 4383 2091 V 65 w(enter)p 4993 2091 V 66 w(pointer\()p
Fs(name)p Fp(\)\))332 2545 y Ft(which)64 b(boxes)g(the)h(function)e
(into)i(a)f(Scheme)g(byte)h(vector)f(and)h(then)f(exports)h(it.)115
b(Note)65 b(that)332 2771 y Fp(s48)p 670 2771 V 66 w(enter)p
1281 2771 V 66 w(pointer)41 b Ft(allocates)g(space)g(in)g(the)g(Scheme)
f(heap)h(and)g(might)f(trigger)h(a)g(garbage)332 2996
y(collection;)46 b(see)g(Section)g(7.9.)368 3417 y Fl(\017)91
b Fp(\(import-definition)i Fs(name)p Fp(\))3536 b Ft(syntax)368
3643 y Fl(\017)91 b Fp(\(import-definition)i Fs(name)e(c-name)p
Fp(\))2916 b Ft(syntax)332 4064 y(These)46 b(macr)m(os)f(simplify)f
(importing)i(de\002nitions)f(fr)m(om)g(C)g(to)h(Scheme.)57
b(They)46 b(expand)f(into)614 4309 y Fp(\(define)110
b Fs(name)f Fp(\(lookup-imported-binding)i Fs(c-name)p
Fp(\)\))332 4555 y Ft(wher)m(e)51 b Fs(c-name)h Ft(is)g(as)g(supplied)g
(for)g(the)g(second)g(form.)76 b(For)52 b(the)g(\002rst)g(form)g
Fs(c-name)f Ft(is)h(derived)332 4781 y(fr)m(om)e Fs(name)i
Ft(by)f(r)m(eplacing)g(`)p Fp(-)p Ft(')g(with)g(`)p 3017
4781 V 65 w(')g(and)g(converting)g(letters)h(to)g(lower)m(case.)74
b(For)52 b(example,)332 5007 y Fp(\(import-definition)111
b(my-foo\))46 b Ft(expands)f(into)614 5252 y Fp(\(define)110
b(my-foo)g(\(lookup-imported-binding)h("my)p 5316 5252
V 66 w(foo"\)\))332 5882 y Fg(7.2.3)198 b(Complete)49
b(shared)g(binding)g(interface)332 6276 y Ft(Ther)m(e)c(ar)m(e)f(a)h
(number)e(of)h(other)h(Scheme)g(functions)e(r)m(elated)i(to)g(shar)m
(ed)f(bindings;)h(these)g(ar)m(e)f(in)332 6502 y(the)i(str)o(uctur)m(e)
e Fp(shared-bindings)p Ft(.)368 6923 y Fl(\017)91 b Fp
(\(shared-binding?)104 b Fs(x)p Fp(\))90 b Fl(!)h Fs(boolean)368
7149 y Fl(\017)g Fp(\(shared-binding-name)i Fs(shar)m(ed-binding)p
Fp(\))88 b Fl(!)j Fs(string)368 7374 y Fl(\017)g Fp
(\(shared-binding-is-import?)104 b Fs(shar)m(ed-binding)p
Fp(\))89 b Fl(!)h Fs(boolean)368 7600 y Fl(\017)h Fp
(\(shared-binding-set!)i Fs(shar)m(ed-binding)88 b(value)p
Fp(\))368 7826 y Fl(\017)j Fp(\(define-imported-binding)i
Fs(string)d(value)p Fp(\))368 8052 y Fl(\017)h Fp
(\(lookup-exported-binding)i Fs(string)p Fp(\))368 8278
y Fl(\017)e Fp(\(undefine-imported-binding)j Fs(string)p
Fp(\))368 8504 y Fl(\017)d Fp(\(undefine-exported-binding)j
Fs(string)p Fp(\))332 8924 y(Shared-binding?)g Ft(is)58
b(the)g(pr)m(edicate)f(for)h(shar)m(ed-bindings.)91 b
Fp(Shared-binding-name)332 9150 y Ft(r)m(eturns)54 b(the)h(name)e(of)i
(a)f(binding.)83 b Fp(Shared-binding-is-import?)j Ft(is)55
b(tr)o(ue)f(if)f(the)i(bind-)332 9376 y(ing)63 b(was)g(de\002ned)g(fr)m
(om)g(C.)g Fp(Shared-binding-set!)112 b Ft(changes)62
b(the)i(value)e(of)h(a)g(binding.)332 9602 y Fp
(Define-imported-binding)69 b Ft(and)d Fp(lookup-exported-binding)i
Ft(ar)m(e)e(Scheme)g(ver)m(-)332 9828 y(sions)72 b(of)f
Fp(s48)p 1385 9828 V 66 w(define)p 2105 9828 V 66 w(exported)p
3043 9828 V 66 w(binding)h Ft(and)f Fp(s48)p 4650 9828
V 66 w(lookup)p 5370 9828 V 66 w(imported)p 6308 9828
V 66 w(binding)p Ft(.)332 10053 y(The)43 b(two)f Fp(undefine-)i
Ft(pr)m(ocedur)m(es)d(r)m(emove)h(bindings)g(fr)m(om)f(the)i(two)f
(tables.)56 b(They)43 b(do)f(noth-)332 10279 y(ing)j(if)g(the)h(name)f
(is)g(not)h(found)f(in)g(the)h(table.)614 10525 y(The)g(following)f(C)g
(macr)m(os)g(corr)m(espond)g(to)h(the)g(Scheme)f(functions)g(above.)368
10946 y Fl(\017)91 b Fp(int)637 b(S48)p 1852 10946 V
66 w(SHARED)p 2572 10946 V 66 w(BINDING)p 3401 10946
V 66 w(P\(x\))368 11171 y Fl(\017)91 b Fp(int)637 b(S48)p
1852 11171 V 66 w(SHARED)p 2572 11171 V 66 w(BINDING)p
3401 11171 V 66 w(IS)p 3685 11171 V 65 w(IMPORT)p 4404
11171 V 66 w(P\(s48)p 5015 11171 V 66 w(value)92 b(s)p
5827 11171 V 65 w(b\))368 11397 y Fl(\017)f Fp(s48)p
888 11397 V 66 w(value)g(S48)p 1917 11397 V 66 w(SHARED)p
2637 11397 V 66 w(BINDING)p 3466 11397 V 66 w(NAME\(s48)p
4404 11397 V 66 w(value)h(s)p 5216 11397 V 65 w(b\))368
11623 y Fl(\017)f Fp(void)546 b(S48)p 1870 11623 V 66
w(SHARED)p 2590 11623 V 66 w(BINDING)p 3419 11623 V 66
w(SET\(s48)p 4248 11623 V 66 w(value)91 b(s)p 5059 11623
V 66 w(b,)g(s48)p 5761 11623 V 66 w(value)g(v\))3661
12141 y Ft(76)p eop end
%%Page: 77 85
TeXDict begin 77 84 bop 166 1146 a Fm(7.3)238 b(Calling)58
b(C)h(functions)h(from)f(Scheme)166 1571 y Ft(Ther)m(e)40
b(ar)m(e)g(thr)m(ee)g(dif)m(fer)m(ent)f(ways)g(to)i(call)f(C)g
(functions)f(fr)m(om)g(Scheme,)i(depending)g(on)f(how)g(the)166
1797 y(C)45 b(function)g(was)g(obtained.)202 2145 y Fl(\017)91
b Fp(\(call-imported-binding)i Fs(binding)d(ar)m(g)3775
2172 y Fn(0)3944 2145 y Fs(.)27 b(.)g(.)g Fp(\))104 b
Fl(!)91 b Fs(value)202 2370 y Fl(\017)g Fp(\(call-external)h
Fs(external)d(ar)m(g)2929 2397 y Fn(0)3098 2370 y Fs(.)27
b(.)g(.)g Fp(\))104 b Fl(!)91 b Fs(value)202 2596 y Fl(\017)g
Fp(\(call-external-value)i Fs(value)d(name)h(ar)m(g)3867
2623 y Fn(0)4036 2596 y Fs(.)27 b(.)g(.)g Fp(\))104 b
Fl(!)90 b Fs(value)166 2944 y Ft(Each)66 b(of)f(these)i(applies)f(its)h
(\002rst)f(ar)m(gument,)k(a)c(C)g(function,)71 b(to)66
b(the)h(r)m(est)f(of)f(the)i(ar)m(guments.)166 3170 y(For)39
b Fp(call-imported-binding)i Ft(the)e(function)f(ar)m(gument)g(must)g
(be)h(an)f(imported)h(binding.)166 3396 y(For)h Fp(call-external)i
Ft(the)e(function)f(ar)m(gument)g(must)g(be)h(an)g(external)g(bound)f
(in)h(the)g(curr)m(ent)166 3622 y(pr)m(ocess)57 b(\(see)f(Section)h
(7.5\).)178 b(For)57 b Fp(call-external-value)h Fs(value)d
Ft(must)h(be)g(a)h(byte)f(vector)166 3848 y(whose)h(contents)g(is)g(a)g
(pointer)h(to)f(a)g(C)g(function)f(and)h Fs(name)g Ft(should)g(be)g(a)g
(string)g(naming)f(the)166 4073 y(function.)g(The)46
b Fs(name)f Ft(ar)m(gument)f(is)i(used)f(only)h(for)f(printing)g(err)m
(or)g(messages.)448 4301 y(For)64 b(all)f(of)h(these,)69
b(the)63 b(C)h(function)e(is)i(passed)g(the)g Fs(ar)m(g)4409
4328 y Fd(i)4528 4301 y Ft(values)f(and)g(the)h(value)f(r)m(eturned)166
4526 y(is)56 b(that)h(r)m(eturned)f(by)f(C)i(pr)m(ocedur)m(e.)88
b(No)57 b(automatic)f(r)m(epr)m(esentation)g(conversion)g(occurs)f(for)
166 4752 y(either)e(ar)m(guments)f(or)h(r)m(eturn)f(values.)78
b(Up)54 b(to)f(twelve)g(ar)m(guments)f(may)g(be)h(passed.)79
b(Ther)m(e)53 b(is)166 4978 y(no)59 b(method)g(supplied)g(for)g(r)m
(eturning)f(multiple)g(values)g(to)i(Scheme)e(fr)m(om)g(C)h(\(or)g
(vice)f(versa\))166 5204 y(\(mainly)44 b(because)h(C)g(does)h(not)g
(have)f(multiple)g(r)m(eturn)g(values\).)448 5431 y(Keyboar)m(d)52
b(interr)o(upts)g(that)g(occur)f(during)h(a)g(call)f(to)i(a)f(C)g
(function)f(ar)m(e)g(ignor)m(ed)h(until)g(the)166 5657
y(function)44 b(r)m(eturns)h(to)h(Scheme)f(\(this)g(is)h(clearly)f(a)g
(pr)m(oblem;)g(we)g(ar)m(e)g(working)h(on)f(a)g(solution\).)202
6005 y Fl(\017)91 b Fp(\(import-lambda-definition)i Fs(name)e
Fp(\()p Fs(formal)f Fp(...\)\))1571 b Ft(syntax)202 6231
y Fl(\017)91 b Fp(\(import-lambda-definition)i Fs(name)e
Fp(\()p Fs(formal)f Fp(...\))h Fs(c-name)p Fp(\))951
b Ft(syntax)166 6579 y(These)46 b(macr)m(os)e(simplify)h(importing)g
(functions)f(fr)m(om)g(C.)i(They)g(de\002ne)f Fs(name)g
Ft(to)h(be)f(a)g(function)166 6805 y(with)69 b(the)h(given)f(formals)g
(that)g(applies)h(those)g(formals)f(to)h(the)g(corr)m(esponding)f(C)g
(binding.)166 7031 y Fs(C-name)p Ft(,)46 b(if)f(supplied,)h(should)f
(be)g(a)h(string.)56 b(These)46 b(expand)g(into)497 7465
y Fp(\(define)109 b(temp)h(\(lookup-imported-binding)h
Fs(c-name)p Fp(\)\))497 7692 y(\(define)e Fs(name)715
7919 y Fp(\(lambda)h(\()p Fs(formal)e Fp(...\))933 8147
y(\(call-imported-binding)j(temp)f Fs(formal)d Fp(...\)\)\))208
8579 y Ft(If)43 b Fs(c-name)e Ft(is)i(not)g(supplied,)g(it)g(is)f
(derived)g(fr)m(om)g Fs(name)g Ft(by)g(converting)g(all)g(letters)h(to)
g(lower)m(case)166 8805 y(and)i(r)m(eplacing)g(`)p Fp(-)p
Ft(')g(with)g(`)p 2047 8805 55 7 v 65 w('.)166 9412 y
Fm(7.4)238 b(Adding)60 b(external)d(modules)i(to)g(the)g
Fk(Makefile)166 9836 y Ft(Getting)c(access)f(to)h(C)g(bindings)f(fr)m
(om)f(Scheme)i(r)m(equir)m(es)e(that)i(the)g(C)g(code)f(be)h(compiled)f
(and)166 10062 y(linked)k(in)f(with)g(the)h(Scheme)f(48)h(virtual)e
(machine)h(and)g(that)h(the)g(r)m(elevant)f(shar)m(ed)g(bindings)166
10288 y(be)45 b(cr)m(eated.)57 b(The)46 b(Scheme)g(48)f(make\002le)g
(has)h(r)o(ules)f(for)g(compiling)g(and)g(linking)h(external)f(code)166
10514 y(and)51 b(for)f(specifying)h(initialization)f(functions)g(that)h
(should)g(be)g(called)f(on)h(startup.)74 b(Ther)m(e)50
b(ar)m(e)166 10740 y(thr)m(ee)41 b Fp(Makefile)i Ft(variables)d(that)i
(contr)m(ol)f(which)f(external)i(modules)f(ar)m(e)g(included)g(in)g
(the)h(ex-)166 10966 y(ecutable)49 b(for)g(the)g(virtual)g(machine)f
(\()p Fp(scheme48vm)p Ft(\).)69 b Fp(EXTERNAL)p 4998
10966 V 66 w(OBJECTS)50 b Ft(lists)g(the)g(object)166
11191 y(\002les)e(to)h(be)f(included)g(in)g Fp(scheme48vm)p
Ft(,)i Fp(EXTERNAL)p 4019 11191 V 66 w(FLAGS)f Ft(is)f(a)g(list)h(of)f
Fp(ld)g Ft(\003ags)g(to)h(be)f(used)166 11417 y(when)39
b(cr)m(eating)h Fp(scheme48vm)p Ft(,)i(and)e Fp(EXTERNAL)p
3751 11417 V 66 w(INITIALIZERS)i Ft(is)e(a)g(list)g(of)g(C)g(pr)m
(ocedur)m(es)166 11643 y(to)56 b(be)f(called)g(on)h(startup.)87
b(The)56 b(pr)m(ocedur)m(es)f(listed)g(in)h Fp(EXTERNAL)p
5031 11643 V 66 w(INITIALIZERS)g Ft(should)3495 12141
y(77)p eop end
%%Page: 78 86
TeXDict begin 78 85 bop 332 1146 a Ft(take)64 b(no)g(ar)m(guments)e
(and)h(have)h(a)f(r)m(eturn)g(type)h(of)f Fp(void)p Ft(.)112
b(After)63 b(changing)g(the)h(de\002nitions)332 1372
y(of)69 b(any)h(of)f(these)h(variables)e(you)h(should)h(do)f
Fp(make)110 b(scheme48vm)70 b Ft(to)g(r)m(ebuild)e(the)i(virtual)332
1597 y(machine.)332 2190 y Fm(7.5)238 b(Dynamic)59 b(loading)332
2612 y Ft(External)47 b(code)h(can)f(be)h(loaded)g(into)f(a)h(r)o
(unning)e(Scheme)h(48)h(pr)m(ocess)g(and)f(C)h(object-\002le)e(bind-)
332 2838 y(ings)73 b(can)g(be)g(der)m(efer)m(enced)g(at)g(r)o(untime)f
(and)h(their)h(values)f(called)g(\(although)f(not)i(all)f(ver)m(-)332
3063 y(sions)52 b(of)f(Unix)g(support)h(all)g(of)f(this\).)74
b(The)52 b(r)m(equir)m(ed)e(Scheme)h(functions)g(ar)m(e)g(in)g(the)g
(str)o(uctur)m(e)332 3289 y Fp(dynamic-externals)p Ft(.)368
3608 y Fl(\017)91 b Fp(\(dynamic-load)h Fs(string)p Fp(\))332
3927 y(Dynamic-load)66 b Ft(loads)g(the)f(named)f(\002le)h(into)h(the)f
(curr)m(ent)f(pr)m(ocess,)70 b(raising)65 b(an)g(exception)332
4152 y(if)e(the)g(\002le)g(cannot)g(be)g(found)g(or)g(if)f(dynamic)h
(loading)g(is)g(not)h(supported)f(by)g(the)h(operating)332
4378 y(system.)93 b(The)58 b(\002le)f(must)g(have)g(been)g(compiled)g
(and)g(linked)g(appr)m(opriately)-20 b(.)93 b(For)58
b(Linux,)i(the)332 4604 y(following)55 b(commands)f(compile)g
Fp(foo.c)i Ft(into)f(a)g(\002le)g Fp(foo.so)h Ft(that)f(can)g(be)g
(loaded)g(dynami-)332 4830 y(cally)-20 b(.)663 5182 y
Fp(\045)109 b(gcc)g(-c)h(-o)f(foo.o)g(foo.c)663 5407
y(\045)g(ld)g(-shared)h(-o)f(foo.so)h(foo.o)368 5759
y Fl(\017)91 b Fp(\(get-external)h Fs(string)p Fp(\))e
Fl(!)h Fs(external)368 5985 y Fl(\017)g Fp(\(external?)103
b Fs(x)p Fp(\))91 b Fl(!)g Fs(boolean)368 6211 y Fl(\017)g
Fp(\(external-name)h Fs(external)p Fp(\))d Fl(!)i Fs(string)368
6437 y Fl(\017)g Fp(\(external-value)i Fs(external)p
Fp(\))c Fl(!)h Fs(byte-vector)332 6755 y Ft(These)55
b(functions)f(give)h(access)f(to)h(values)f(bound)g(in)h(the)g(curr)m
(ent)e(pr)m(ocess,)58 b(and)d(ar)m(e)f(used)g(for)332
6981 y(r)m(etrieving)h(values)g(fr)m(om)f(dynamically-loaded)g
(\002les.)87 b Fp(Get-external)56 b Ft(r)m(eturns)f(an)g
Fs(external)332 7207 y Ft(object)45 b(that)h(contains)g(the)g(value)f
(of)h Fs(name)p Ft(,)g(raising)f(an)h(exception)g(if)f(ther)m(e)h(is)f
(no)h(such)f(value)g(in)332 7433 y(the)k(curr)m(ent)e(pr)m(ocess.)66
b Fp(External?)h Ft(is)49 b(the)f(pr)m(edicate)h(for)f(externals,)i
(and)e Fp(external-name)332 7659 y Ft(and)66 b Fp(external-value)h
Ft(r)m(eturn)e(the)i(name)e(and)h(value)f(of)h(an)g(external.)118
b(The)67 b(value)e(is)h(r)m(e-)332 7885 y(turned)50 b(as)g(byte)g
(vector)g(of)g(length)g(four)f(\(on)h(32-bit)f(ar)m(chitectur)m(es\).)
69 b(The)50 b(value)g(is)g(that)g(which)332 8110 y(was)69
b(extant)g(when)f Fp(get-external)i Ft(was)f(called.)127
b(The)69 b(following)g(two)g(functions)f(can)g(be)332
8336 y(used)45 b(to)h(update)g(the)g(values)f(of)g(externals.)368
8655 y Fl(\017)91 b Fp(\(lookup-external)i Fs(external)p
Fp(\))c Fl(!)h Fs(boolean)368 8881 y Fl(\017)h Fp
(\(lookup-all-externals\))i Fl(!)e Fs(boolean)332 9199
y Fp(Lookup-external)118 b Ft(updates)f(the)g(value)f(of)g
Fs(external)f Ft(by)h(looking)h(up)f(its)h(name)f(in)332
9425 y(the)e(curr)m(ent)f(pr)m(ocess,)131 b(r)m(eturning)113
b Fp(#t)g Ft(if)h(the)f(name)g(is)h(bound)f(and)h Fp(#f)g
Ft(if)f(it)h(is)f(not.)332 9651 y Fp(Lookup-all-externals)64
b Ft(calls)d Fp(lookup-external)i Ft(on)e(all)h(extant)f(externals,)66
b(r)m(eturn-)332 9877 y(ing)45 b Fp(#f)h Ft(any)f(ar)m(e)g(unbound.)368
10195 y Fl(\017)91 b Fp(\(call-external)h Fs(external)d(ar)m(g)3095
10222 y Fn(0)3264 10195 y Fs(.)27 b(.)g(.)g Fp(\))104
b Fl(!)91 b Fs(value)332 10514 y Ft(An)52 b(external)f(whose)g(value)f
(is)h(a)g(C)h(pr)m(ocedur)m(e)e(can)h(be)g(called)f(using)h
Fp(call-external)p Ft(.)75 b(See)332 10740 y(Section)46
b(7.3)91 b(for)45 b(mor)m(e)g(information.)614 10966
y(In)52 b(some)f(versions)g(of)f(Unix)i(r)m(etrieving)e(a)h(value)f(fr)
m(om)g(the)i(curr)m(ent)e(pr)m(ocess)h(may)f(r)m(equir)m(e)332
11191 y(a)j(non-trivial)f(amount)g(of)g(computation.)79
b(W)-17 b(e)53 b(r)m(ecommend)f(that)h(a)f(dynamically-loaded)g(\002le)
332 11417 y(contain)65 b(a)g(single)h(initialization)f(pr)m(ocedur)m(e)
f(that)i(cr)m(eates)f(shar)m(ed)g(bindings)f(for)h(the)h(values)332
11643 y(exported)46 b(by)f(the)h(\002le.)3661 12141 y(78)p
eop end
%%Page: 79 87
TeXDict begin 79 86 bop 166 1146 a Fm(7.6)238 b(Compatibility)166
1573 y Ft(Scheme)128 b(48's)f(old)h Fp(external-call)h
Ft(function)e(is)h(still)g(available)f(in)g(the)h(str)o(uctur)m(e)166
1799 y Fp(externals)p Ft(,)45 b(which)d(now)h(also)g(includes)g
Fp(external-name)h Ft(and)f Fp(external-value)p Ft(.)58
b(The)166 2025 y(old)46 b Fp(scheme48.h)g Ft(\002le)g(has)f(been)g(r)m
(enamed)f Fp(old-scheme48.h)p Ft(.)166 2640 y Fm(7.7)238
b(Accessing)60 b(Scheme)e(data)h(from)g(C)166 3067 y
Ft(The)67 b(C)g(header)f(\002le)h Fp(scheme48.h)g Ft(pr)m(ovides)g
(access)f(to)h(Scheme)f(48)h(data)g(str)o(uctur)m(es.)119
b(The)166 3293 y(type)74 b Fp(s48)p 934 3293 55 7 v 66
w(value)g Ft(is)f(used)g(for)g(Scheme)g(values.)140 b(When)73
b(the)h(type)g(of)f(a)g(value)g(is)g(known,)166 3519
y(such)50 b(as)h(the)g(integer)g(r)m(eturned)f(by)g Fp(vector-length)i
Ft(or)f(the)g(boolean)g(r)m(eturned)f(by)g Fp(pair?)p
Ft(,)166 3745 y(the)57 b(corr)m(esponding)g(C)g(pr)m(ocedur)m(e)f(r)m
(eturns)g(a)h(C)g(value)f(of)h(the)g(appr)m(opriate)g(type,)k(and)c
(not)g(a)166 3971 y Fp(s48)p 504 3971 V 66 w(value)p
Ft(.)g(Pr)m(edicates)45 b(r)m(eturn)g Fp(1)g Ft(for)g(tr)o(ue)g(and)g
Fp(0)h Ft(for)f(false.)166 4498 y Fg(7.7.1)198 b(Constants)166
4857 y Ft(The)46 b(following)f(macr)m(os)f(denote)i(Scheme)f
(constants:)439 5244 y Fl(\017)91 b Fp(S48)p 959 5244
V 65 w(FALSE)46 b Ft(is)g Fp(#f)p Ft(.)439 5630 y Fl(\017)91
b Fp(S48)p 959 5630 V 65 w(TRUE)46 b Ft(is)g Fp(#t)p
Ft(.)439 6017 y Fl(\017)91 b Fp(S48)p 959 6017 V 65 w(NULL)46
b Ft(is)g(the)f(empty)h(list.)439 6404 y Fl(\017)91 b
Fp(S48)p 959 6404 V 65 w(UNSPECIFIC)103 b Ft(is)f(a)f(value)g(used)h
(for)f(functions)g(which)f(have)i(no)f(meaning-)621 6629
y(ful)74 b(r)m(eturn)g(value)g(\(in)g(Scheme)h(48)g(this)g(value)f(r)m
(eturned)h(by)f(the)i(nullary)e(pr)m(ocedur)m(e)621 6855
y Fp(unspecific)46 b Ft(in)f(the)h(str)o(uctur)m(e)e
Fp(util)p Ft(\).)439 7242 y Fl(\017)91 b Fp(S48)p 959
7242 V 65 w(EOF)73 b Ft(is)f(the)g(end-of-\002le)f(object)h(\(in)g
(Scheme)f(48)i(this)f(value)f(is)h(r)m(eturned)g(by)g(the)621
7468 y(nullary)44 b(pr)m(ocedur)m(e)h Fp(eof-object)h
Ft(in)f(the)h(str)o(uctur)m(e)e Fp(i/o-internal)p Ft(\).)166
7995 y Fg(7.7.2)198 b(Converting)48 b(values)166 8354
y Ft(The)f(following)f(macr)m(os)g(and)g(functions)g(convert)g(values)g
(between)h(Scheme)f(and)g(C)h(r)m(epr)m(esen-)166 8580
y(tations.)122 b(The)68 b(`extract')e(ones)h(convert)g(fr)m(om)f
(Scheme)h(to)h(C)f(and)g(the)g(`enter)13 b('s)67 b(go)g(the)h(other)166
8806 y(way)-20 b(.)202 9159 y Fl(\017)91 b Fp(int)637
b(S48)p 1686 9159 V 66 w(EXTRACT)p 2515 9159 V 66 w(BOOLEAN\(s48)p
3780 9159 V 66 w(value\))202 9385 y Fl(\017)91 b Fp(unsigned)h(char)f
(s48)p 2213 9385 V 66 w(extract)p 3042 9385 V 66 w(char\(s48)p
3980 9385 V 66 w(value\))202 9611 y Fl(\017)g Fp(char)g(*)364
b(s48)p 1722 9611 V 66 w(extract)p 2551 9611 V 66 w(string\(s48)p
3707 9611 V 66 w(value\))202 9836 y Fl(\017)91 b Fp(char)g(*)364
b(s48)p 1722 9836 V 66 w(extract)p 2551 9836 V 66 w(byte)p
3053 9836 V 66 w(vector\(s48)p 4209 9836 V 66 w(value\))202
10062 y Fl(\017)91 b Fp(long)546 b(s48)p 1704 10062 V
66 w(extract)p 2533 10062 V 66 w(integer\(s48)p 3798
10062 V 66 w(value\))202 10288 y Fl(\017)91 b Fp(double)364
b(s48)p 1740 10288 V 66 w(extract)p 2569 10288 V 66 w(double\(s48)p
3725 10288 V 67 w(value\))202 10514 y Fl(\017)91 b Fp(s48)p
722 10514 V 66 w(value)g(S48)p 1751 10514 V 66 w(ENTER)p
2362 10514 V 66 w(BOOLEAN\(int\))202 10740 y Fl(\017)g
Fp(s48)p 722 10740 V 66 w(value)g(s48)p 1751 10740 V
66 w(enter)p 2362 10740 V 66 w(char\(unsigned)h(char\))202
10966 y Fl(\017)f Fp(s48)p 722 10966 V 66 w(value)g(s48)p
1751 10966 V 66 w(enter)p 2362 10966 V 66 w(string\(char)h(*\))2293
b Ft(\(may)45 b(GC\))202 11191 y Fl(\017)91 b Fp(s48)p
722 11191 V 66 w(value)g(s48)p 1751 11191 V 66 w(enter)p
2362 11191 V 66 w(byte)p 2864 11191 V 66 w(vector\(char)h(*,)f(long\))
1155 b Ft(\(may)45 b(GC\))202 11417 y Fl(\017)91 b Fp(s48)p
722 11417 V 66 w(value)g(s48)p 1751 11417 V 66 w(enter)p
2362 11417 V 66 w(integer\(long\))2385 b Ft(\(may)45
b(GC\))202 11643 y Fl(\017)91 b Fp(s48)p 722 11643 V
66 w(value)g(s48)p 1751 11643 V 66 w(enter)p 2362 11643
V 66 w(double\(double\))2276 b Ft(\(may)45 b(GC\))3495
12141 y(79)p eop end
%%Page: 80 88
TeXDict begin 80 87 bop 332 1146 a Fp(S48)p 670 1146
55 7 v 66 w(EXTRACT)p 1499 1146 V 66 w(BOOLEAN)146 b
Ft(is)f(false)f(if)h(its)g(ar)m(gument)f(is)h Fp(#f)g
Ft(and)g(tr)o(ue)g(otherwise.)332 1372 y Fp(S48)p 670
1372 V 66 w(ENTER)p 1281 1372 V 66 w(BOOLEAN)46 b Ft(is)f
Fp(#f)h Ft(if)f(its)h(ar)m(gument)e(is)h(zer)m(o)h(and)f
Fp(#t)h Ft(otherwise.)614 1597 y Fp(s48)p 952 1597 V
66 w(extract)p 1781 1597 V 66 w(string)71 b Ft(and)f
Fp(s48)p 3277 1597 V 65 w(extract)p 4105 1597 V 66 w(byte)p
4607 1597 V 66 w(vector)h Ft(r)m(eturn)e(pointers)h(to)h(the)332
1823 y(actual)41 b(storage)g(used)g(by)g(the)g(string)g(or)h(byte)f
(vector)-13 b(.)54 b(These)42 b(pointers)g(ar)m(e)e(valid)h(only)g
(until)g(the)332 2049 y(next)46 b(garbage)e(collection;)i(see)g
(Section)g(7.9.)614 2275 y(The)g(second)g(ar)m(gument)e(to)i
Fp(s48)p 2941 2275 V 66 w(enter)p 3552 2275 V 66 w(byte)p
4054 2275 V 66 w(vector)g Ft(is)f(the)h(length)f(of)g(byte)h(vector)-13
b(.)614 2501 y Fp(s48)p 952 2501 V 66 w(enter)p 1563
2501 V 66 w(integer\(\))54 b Ft(needs)g(to)g(allocate)f(storage)h(when)
f(its)h(ar)m(gument)e(is)h(too)i(lar)m(ge)332 2726 y(to)70
b(\002t)f(in)g(a)f(Scheme)h(48)g(\002xnum.)126 b(In)69
b(cases)g(wher)m(e)f(the)h(number)f(is)h(known)f(to)i(\002t)f(within)f
(a)332 2952 y(\002xnum)57 b(\(curr)m(ently)g(30)h(bits)g(including)f
(the)h(sign\),)j(the)d(following)g(pr)m(ocedur)m(es)f(can)h(be)g(used.)
332 3178 y(These)68 b(have)f(the)h(disadvantage)f(of)g(only)h(having)f
(a)g(limited)g(range,)73 b(but)67 b(the)h(advantage)f(of)332
3404 y(never)41 b(causing)f(a)h(garbage)f(collection.)55
b Fp(S48)p 3512 3404 V 66 w(FIXNUM)p 4232 3404 V 66 w(P)41
b Ft(is)g(a)g(macr)m(o)f(that)h(tr)o(ue)g(if)f(its)h(ar)m(gument)332
3630 y(is)46 b(a)f(\002xnum)f(and)h(false)g(otherwise.)368
3959 y Fl(\017)91 b Fp(int)637 b(S48)p 1852 3959 V 66
w(TRUE)p 2354 3959 V 65 w(P\(s48)p 2964 3959 V 66 w(value\))368
4185 y Fl(\017)91 b Fp(int)637 b(S48)p 1852 4185 V 66
w(FALSE)p 2463 4185 V 66 w(P\(s48)p 3074 4185 V 65 w(value\))332
4515 y(S48)p 670 4515 V 66 w(TRUE)p 1172 4515 V 66 w(P)52
b Ft(is)f(tr)o(ue)g(if)h(its)g(ar)m(gument)e(is)i Fp(S48)p
3708 4515 V 66 w(TRUE)g Ft(and)g Fp(S48)p 4949 4515 V
65 w(FALSE)p 5559 4515 V 66 w(P)g Ft(is)g(tr)o(ue)f(if)g(its)h(ar)m
(gu-)332 4740 y(ment)45 b(is)h Fp(S48)p 1304 4740 V 65
w(FALSE)p Ft(.)368 5070 y Fl(\017)91 b Fp(int)637 b(S48)p
1852 5070 V 66 w(FIXNUM)p 2572 5070 V 66 w(P\(s48)p 3183
5070 V 66 w(value\))368 5296 y Fl(\017)91 b Fp(long)546
b(s48)p 1870 5296 V 66 w(extract)p 2699 5296 V 66 w(fixnum\(s48)p
3855 5296 V 66 w(value\))368 5522 y Fl(\017)91 b Fp(s48)p
888 5522 V 66 w(value)g(s48)p 1917 5522 V 66 w(enter)p
2528 5522 V 66 w(fixnum\(long\))368 5747 y Fl(\017)g
Fp(long)546 b(S48)p 1870 5747 V 66 w(MAX)p 2263 5747
V 66 w(FIXNUM)p 2983 5747 V 66 w(VALUE)368 5973 y Fl(\017)91
b Fp(long)546 b(S48)p 1870 5973 V 66 w(MIN)p 2263 5973
V 66 w(FIXNUM)p 2983 5973 V 66 w(VALUE)332 6303 y Ft(An)44
b(err)m(or)f(is)h(signalled)f(if)g Fp(s48)p 2509 6303
V 66 w(extract)p 3338 6303 V 66 w(fixnum)p Ft('s)h(ar)m(gument)e(is)i
(not)g(a)f(\002xnum)g(or)g(if)g(the)h(ar)m(-)332 6529
y(gument)51 b(to)h Fp(s48)p 1555 6529 V 66 w(enter)p
2166 6529 V 66 w(fixnum)g Ft(is)g(less)f(than)h Fp(S48)p
4206 6529 V 65 w(MIN)p 4598 6529 V 66 w(FIXNUM)p 5318
6529 V 66 w(VALUE)g Ft(or)g(gr)m(eater)f(than)332 6754
y Fp(S48)p 670 6754 V 66 w(MAX)p 1063 6754 V 66 w(FIXNUM)p
1783 6754 V 66 w(VALUE)45 b Ft(\()p Fl(\000)p Fi(2)2721
6688 y Fn(29)2916 6754 y Ft(and)g Fi(2)3360 6688 y Fn(29)3550
6754 y Fl(\000)c Fi(1)k Ft(in)h(the)f(curr)m(ent)g(system\).)332
7261 y Fg(7.7.3)198 b(C)50 b(versions)f(of)g(Scheme)g(procedures)332
7615 y Ft(The)76 b(following)f(macr)m(os)g(and)g(pr)m(ocedur)m(es)g(ar)
m(e)g(C)g(versions)h(of)f(Scheme)g(pr)m(ocedur)m(es.)147
b(The)332 7841 y(names)45 b(wer)m(e)g(derived)g(by)g(r)m(eplacing)g(`)p
Fp(-)p Ft(')g(with)g(`)p 3783 7841 V 65 w(',)g(`)p Fp(?)p
Ft(')56 b(with)45 b(`)p 4722 7841 V 65 w Fp(P)p Ft(',)g(and)g(dr)m
(opping)h(`)p Fp(!)p Ft(.)368 8170 y Fl(\017)91 b Fp(int)637
b(S48)p 1852 8170 V 66 w(EQ)p 2136 8170 V 65 w(P\(s48)p
2746 8170 V 66 w(value,)92 b(s48)p 3885 8170 V 65 w(VALUE\))368
8396 y Fl(\017)f Fp(int)637 b(S48)p 1852 8396 V 66 w(CHAR)p
2354 8396 V 65 w(P\(s48)p 2964 8396 V 66 w(value\))368
8726 y Fl(\017)91 b Fp(int)637 b(S48)p 1852 8726 V 66
w(PAIR)p 2354 8726 V 65 w(P\(s48)p 2964 8726 V 66 w(value\))368
8952 y Fl(\017)91 b Fp(s48)p 888 8952 V 66 w(value)g(S48)p
1917 8952 V 66 w(CAR\(s48)p 2746 8952 V 66 w(value\))368
9177 y Fl(\017)g Fp(s48)p 888 9177 V 66 w(value)g(S48)p
1917 9177 V 66 w(CDR\(s48)p 2746 9177 V 66 w(value\))368
9403 y Fl(\017)g Fp(void)546 b(S48)p 1870 9403 V 66 w(SET)p
2263 9403 V 66 w(CAR\(s48)p 3092 9403 V 66 w(value,)91
b(s48)p 4230 9403 V 66 w(value\))368 9629 y Fl(\017)g
Fp(void)546 b(S48)p 1870 9629 V 66 w(SET)p 2263 9629
V 66 w(CDR\(s48)p 3092 9629 V 66 w(value,)91 b(s48)p
4230 9629 V 66 w(value\))368 9855 y Fl(\017)g Fp(s48)p
888 9855 V 66 w(value)g(s48)p 1917 9855 V 66 w(cons\(s48)p
2855 9855 V 66 w(value,)h(s48)p 3994 9855 V 65 w(value\))1683
b Ft(\(may)45 b(GC\))368 10081 y Fl(\017)91 b Fp(long)546
b(s48)p 1870 10081 V 66 w(length\(s48)p 3026 10081 V
66 w(value\))368 10410 y Fl(\017)91 b Fp(int)637 b(S48)p
1852 10410 V 66 w(VECTOR)p 2572 10410 V 66 w(P\(s48)p
3183 10410 V 66 w(value\))368 10636 y Fl(\017)91 b Fp(long)546
b(S48)p 1870 10636 V 66 w(VECTOR)p 2590 10636 V 66 w(LENGTH\(s48)p
3746 10636 V 66 w(value\))368 10862 y Fl(\017)91 b Fp(s48)p
888 10862 V 66 w(value)g(S48)p 1917 10862 V 66 w(VECTOR)p
2637 10862 V 66 w(REF\(s48)p 3466 10862 V 66 w(value,)h(long\))368
11088 y Fl(\017)f Fp(void)546 b(S48)p 1870 11088 V 66
w(VECTOR)p 2590 11088 V 66 w(SET\(s48)p 3419 11088 V
66 w(value,)91 b(long,)h(s48)p 5194 11088 V 65 w(value\))368
11314 y Fl(\017)f Fp(s48)p 888 11314 V 66 w(value)g(s48)p
1917 11314 V 66 w(make)p 2419 11314 V 66 w(vector\(long,)h(s48)p
4212 11314 V 66 w(value\))1464 b Ft(\(may)45 b(GC\))368
11643 y Fl(\017)91 b Fp(int)637 b(S48)p 1852 11643 V
66 w(STRING)p 2572 11643 V 66 w(P\(s48)p 3183 11643 V
66 w(value\))3661 12141 y Ft(80)p eop end
%%Page: 81 89
TeXDict begin 81 88 bop 202 1146 a Fl(\017)91 b Fp(long)546
b(S48)p 1704 1146 55 7 v 66 w(STRING)p 2424 1146 V 66
w(LENGTH\(s48)p 3580 1146 V 66 w(value\))202 1372 y Fl(\017)91
b Fp(char)546 b(S48)p 1704 1372 V 66 w(STRING)p 2424
1372 V 66 w(REF\(s48)p 3253 1372 V 66 w(value,)91 b(long\))202
1597 y Fl(\017)g Fp(void)546 b(S48)p 1704 1597 V 66 w(STRING)p
2424 1597 V 66 w(SET\(s48)p 3253 1597 V 66 w(value,)91
b(long,)h(char\))202 1823 y Fl(\017)f Fp(s48)p 722 1823
V 66 w(value)g(s48)p 1751 1823 V 66 w(make)p 2253 1823
V 66 w(string\(long,)h(char\))1966 b Ft(\(may)45 b(GC\))202
2219 y Fl(\017)91 b Fp(int)637 b(S48)p 1686 2219 V 66
w(SYMBOL)p 2406 2219 V 66 w(P\(s48)p 3017 2219 V 65 w(value\))202
2445 y Fl(\017)91 b Fp(s48)p 722 2445 V 66 w(value)g(s48)p
1751 2445 V 66 w(SYMBOL)p 2471 2445 V 66 w(TO)p 2755
2445 V 66 w(STRING\(s48)p 3911 2445 V 66 w(value\))202
2840 y Fl(\017)g Fp(int)637 b(S48)p 1686 2840 V 66 w(BYTE)p
2188 2840 V 65 w(VECTOR)p 2907 2840 V 66 w(P\(s48)p 3518
2840 V 66 w(value\))202 3066 y Fl(\017)91 b Fp(long)546
b(S48)p 1704 3066 V 66 w(BYTE)p 2206 3066 V 66 w(VECTOR)p
2926 3066 V 66 w(LENGTH\(s48)p 4082 3066 V 66 w(value\))202
3292 y Fl(\017)91 b Fp(char)546 b(S48)p 1704 3292 V 66
w(BYTE)p 2206 3292 V 66 w(VECTOR)p 2926 3292 V 66 w(REF\(s48)p
3755 3292 V 66 w(value,)91 b(long\))202 3518 y Fl(\017)g
Fp(void)546 b(S48)p 1704 3518 V 66 w(BYTE)p 2206 3518
V 66 w(VECTOR)p 2926 3518 V 66 w(SET\(s48)p 3755 3518
V 66 w(value,)91 b(long,)g(int\))202 3744 y Fl(\017)g
Fp(s48)p 722 3744 V 66 w(value)g(s48)p 1751 3744 V 66
w(make)p 2253 3744 V 66 w(byte)p 2755 3744 V 66 w(vector\(long,)h
(int\))1573 b Ft(\(may)45 b(GC\))166 4451 y Fm(7.8)238
b(Calling)58 b(Scheme)h(functions)g(from)h(C)166 4909
y Ft(External)c(code)h(that)g(has)g(been)f(called)g(fr)m(om)g(Scheme)g
(can)g(call)g(back)g(to)h(Scheme)g(pr)m(ocedur)m(es)166
5135 y(using)45 b(the)h(following)e(function.)202 5548
y Fl(\017)91 b Fp(s48)p 722 5548 V 66 w(value)g(s48)p
1751 5548 V 66 w(call)p 2253 5548 V 66 w(scheme\(s48)p
3409 5548 V 66 w(value)h(p,)f(long)g(nargs,)g(...\))166
5962 y Ft(This)61 b(calls)f(the)h(Scheme)f(pr)m(ocedur)m(e)g
Fp(p)h Ft(on)g Fp(nargs)g Ft(ar)m(guments,)j(which)59
b(ar)m(e)i(passed)g(as)f(addi-)166 6188 y(tional)40 b(ar)m(guments)f
(to)i Fp(s48)p 2104 6188 V 65 w(call)p 2605 6188 V 66
w(scheme)p Ft(.)56 b(Ther)m(e)40 b(may)f(be)h(at)g(most)g(twelve)g(ar)m
(guments.)54 b(The)166 6413 y(value)36 b(r)m(eturned)h(by)f(the)h
(Scheme)g(pr)m(ocedur)m(e)f(is)h(r)m(eturned)f(by)h(the)g(C)g(pr)m
(ocedur)m(e.)53 b(Invoking)37 b(any)166 6639 y(Scheme)45
b(pr)m(ocedur)m(e)g(may)g(potentially)h(cause)f(a)g(garbage)g
(collection.)448 6883 y(Ther)m(e)74 b(ar)m(e)f(some)h(complications)f
(that)h(occur)e(when)h(mixing)g(calls)g(fr)m(om)g(C)g(to)h(Scheme)166
7109 y(with)91 b(continuations)g(and)g(thr)m(eads.)193
b(C)91 b(only)g(supports)h(downwar)m(d)e(continuations)h(\(via)166
7335 y Fp(longjmp\(\))p Ft(\).)138 b(Scheme)72 b(continuations)g(that)g
(captur)m(e)g(a)g(portion)h(of)g(the)f(C)g(stack)h(have)e(to)166
7560 y(follow)g(the)h(same)g(r)m(estriction.)136 b(For)72
b(example,)78 b(suppose)73 b(Scheme)e(pr)m(ocedur)m(e)g
Fp(s0)i Ft(captur)m(es)166 7786 y(continuation)52 b Fp(a)g
Ft(and)g(then)g(calls)g(C)g(pr)m(ocedur)m(e)g Fp(c0)p
Ft(,)i(which)d(in)h(turn)g(calls)g(Scheme)g(pr)m(ocedur)m(e)166
8012 y Fp(s1)p Ft(.)68 b(Pr)m(ocedur)m(e)48 b Fp(s1)h
Ft(can)f(safely)h(call)f(the)h(continuation)g Fp(a)p
Ft(,)h(because)f(that)g(is)g(a)g(downwar)m(d)f(use.)166
8238 y(When)59 b Fp(a)h Ft(is)g(called)f(Scheme)g(48)h(will)f(r)m
(emove)g(the)h(portion)g(of)g(the)f(C)h(stack)g(used)f(by)h(the)g(call)
166 8464 y(to)55 b Fp(c0)p Ft(.)84 b(On)54 b(the)h(other)g(hand,)i(if)c
Fp(s1)i Ft(captur)m(es)f(a)g(continuation,)j(that)e(continuation)f
(cannot)g(be)166 8690 y(used)g(fr)m(om)g Fp(s0)p Ft(,)j(because)d(by)g
(the)h(time)f(contr)m(ol)g(r)m(eturns)g(to)h Fp(s0)g
Ft(the)f(C)h(stack)f(used)h(by)f Fp(c0)h Ft(will)166
8915 y(no)50 b(longer)g(be)g(valid.)69 b(An)51 b(attempt)f(to)h(invoke)
f(an)f(upwar)m(d)g(continuation)h(that)g(is)g(closed)g(over)166
9141 y(a)45 b(portion)h(of)g(the)f(C)h(stack)f(will)g(raise)g(an)h
(exception.)448 9385 y(In)k(Scheme)f(48)h(thr)m(eads)f(ar)m(e)g
(implemented)h(using)f(continuations,)i(so)e(the)h(downwar)m(d)f(r)m
(e-)166 9611 y(striction)63 b(applies)g(to)g(them)f(as)g(well.)108
b(An)62 b(attempt)i(to)f(r)m(eturn)e(fr)m(om)h(Scheme)g(to)h(C)f(at)h
(a)f(time)166 9836 y(when)38 b(the)h(appr)m(opriate)g(C)g(frame)f(is)g
(not)h(on)g(top)h(of)e(the)h(C)g(stack)g(will)f(cause)g(the)h(curr)m
(ent)e(thr)m(ead)166 10062 y(to)50 b(block)f(until)f(the)i(frame)e(is)h
(available.)67 b(For)49 b(example,)h(suppose)g(thr)m(ead)f
Fp(t0)h Ft(calls)e(a)h(C)h(pr)m(oce-)166 10288 y(dur)m(e)45
b(which)g(calls)h(back)f(to)i(Scheme,)f(at)h(which)e(point)h(contr)m
(ol)g(switches)g(to)g(thr)m(ead)g Fp(t1)p Ft(,)h(which)166
10514 y(also)42 b(calls)g(C)g(and)g(then)g(back)g(to)g(Scheme.)56
b(At)43 b(this)f(point)h(both)f Fp(t0)g Ft(and)g Fp(t1)g
Ft(have)g(active)g(calls)f(to)166 10740 y(C)50 b(on)g(the)g(C)g(stack,)
h(with)e Fp(t1)p Ft('s)h(C)g(frame)f(above)g Fp(t0)p
Ft('s.)70 b(If)50 b(thr)m(ead)f Fp(t0)h Ft(attempts)h(to)f(r)m(eturn)f
(fr)m(om)166 10966 y(Scheme)61 b(to)g(C)g(it)g(will)f(block,)65
b(as)c(its)g(frame)f(is)h(not)h(accessible.)102 b(Once)60
b Fp(t1)i Ft(has)e(r)m(eturned)h(to)g(C)166 11191 y(and)41
b(fr)m(om)f(ther)m(e)h(to)h(Scheme,)g Fp(t0)g Ft(will)e(be)h(able)g(to)
h(r)m(esume.)54 b(The)42 b(r)m(eturn)e(to)i(Scheme)f(is)g(r)m(equir)m
(ed)166 11417 y(because)53 b(context)h(switches)g(can)g(only)g(occur)f
(while)g(Scheme)h(code)g(is)g(r)o(unning.)81 b Fp(T0)54
b Ft(will)g(also)166 11643 y(be)45 b(able)g(to)h(r)m(esume)e(if)h
Fp(t1)h Ft(uses)f(a)h(continuation)f(to)h(thr)m(ow)f(past)h(its)g(call)
e(to)i(C.)3495 12141 y(81)p eop end
%%Page: 82 90
TeXDict begin 82 89 bop 332 1146 a Fm(7.9)238 b(Interacting)58
b(with)h(the)g(Scheme)g(heap)332 1568 y Ft(Scheme)44
b(48)h(uses)f(a)g(copying,)i(pr)m(ecise)e(garbage)g(collector)-13
b(.)56 b(Any)45 b(pr)m(ocedur)m(e)e(that)i(allocates)g(ob-)332
1793 y(jects)63 b(within)g(the)h(Scheme)f(48)g(heap)g(may)g(trigger)h
(a)f(garbage)g(collection.)111 b(V)-17 b(ariables)63
b(bound)332 2019 y(to)77 b(values)f(in)g(the)h(Scheme)g(48)f(heap)h
(need)f(to)h(be)g(r)m(egister)m(ed)f(with)g(the)h(garbage)f(collector)
332 2245 y(so)e(that)f(the)h(value)e(will)h(be)g(r)m(etained)f(and)i
(so)f(that)h(the)f(variables)f(will)h(be)g(updated)g(if)g(the)332
2471 y(garbage)61 b(collector)h(moves)f(the)h(object.)106
b(The)62 b(garbage)f(collector)h(has)f(no)h(facility)f(for)g(updat-)332
2697 y(ing)42 b(pointers)g(to)g(the)g(interiors)f(of)h(objects,)g(so)g
(such)f(pointers,)i(for)f(example)f(the)h(ones)g(r)m(eturned)332
2923 y(by)j Fp(EXTRACT)p 1353 2923 55 7 v 66 w(STRING)p
Ft(,)i(will)e(likely)g(become)g(invalid)f(when)h(a)h(garbage)e
(collection)i(occurs.)332 3431 y Fg(7.9.1)198 b(Registering)49
b(objects)i(with)f(the)f(GC)332 3785 y Ft(A)41 b(set)g(of)f(macr)m(os)f
(ar)m(e)h(used)g(to)h(manage)f(the)g(r)m(egistration)h(of)f(local)g
(variables)f(with)h(the)h(garbage)332 4011 y(collector)-13
b(.)368 4349 y Fl(\017)91 b Fp(S48)p 888 4349 V 66 w(DECLARE)p
1717 4349 V 66 w(GC)p 2001 4349 V 66 w(PROTECT\()p Fh(n)p
Fp(\))368 4575 y Fl(\017)g Fp(void)h(S48)p 1416 4575
V 65 w(GC)p 1699 4575 V 66 w(PROTECT)p 2528 4575 V 66
w Fh(n)p Fp(\(s48)p 3139 4575 V 66 w(value)3739 4602
y Fn(1)3818 4575 y Fp(,)f Fh(:)30 b(:)g(:)o Fp(,)91 b(s48)p
4768 4575 V 66 w(value)5368 4602 y Fd(n)5463 4575 y Fp(\))368
4800 y Fl(\017)g Fp(void)h(S48)p 1416 4800 V 65 w(GC)p
1699 4800 V 66 w(UNPROTECT\(\))614 5138 y(S48)p 952 5138
V 66 w(DECLARE)p 1781 5138 V 66 w(GC)p 2065 5138 V 66
w(PROTECT\()p Fh(n)p Fp(\))p Ft(,)79 b(wher)m(e)71 b
Fi(1)99 b Fl(\024)h Fh(n)f Fl(\024)h Fi(9)p Ft(,)78 b(allocates)72
b(storage)g(for)g(r)m(egis-)332 5364 y(tering)66 b Fh(n)g
Ft(variables.)118 b(At)66 b(most)h(one)f(use)g(of)g Fp(S48)p
3933 5364 V 65 w(DECLARE)p 4761 5364 V 66 w(GC)p 5045
5364 V 66 w(PROTECT)h Ft(may)e(occur)g(in)h(a)332 5590
y(block.)59 b Fp(S48)p 1209 5590 V 66 w(GC)p 1493 5590
V 65 w(PROTECT)p 2321 5590 V 66 w Fh(n)p Fp(\()p Fh(v)2682
5617 y Fn(1)2762 5590 y Fp(,)109 b Fh(:)30 b(:)g(:)o
Fp(,)109 b Fh(v)3498 5617 y Fd(n)3592 5590 y Fp(\))47
b Ft(r)m(egisters)f(the)g Fh(n)h Ft(variables)e(\(l-values\))f(with)i
(the)332 5816 y(garbage)59 b(collector)-13 b(.)97 b(It)60
b(must)e(be)h(within)f(scope)i(of)f(a)g Fp(S48)p 4547
5816 V 66 w(DECLARE)p 5376 5816 V 66 w(GC)p 5660 5816
V 65 w(PROTECT\()p Fh(n)p Fp(\))h Ft(and)332 6042 y(be)e(befor)m(e)f
(any)g(code)h(which)f(can)g(cause)h(a)g(GC.)g Fp(S48)p
4182 6042 V 65 w(GC)p 4465 6042 V 66 w(UNPROTECT)h Ft(r)m(emoves)e(the)
h(block's)332 6267 y(pr)m(otected)43 b(variables)e(fr)m(om)g(the)h
(garbage)g(collector)13 b('s)42 b(list.)56 b(It)43 b(must)e(be)h
(called)g(at)g(the)h(end)f(of)g(the)332 6493 y(block)k(after)g(any)g
(code)h(which)e(may)h(cause)g(a)g(garbage)g(collection.)59
b(Omitting)46 b(any)h(of)f(the)g(thr)m(ee)332 6719 y(may)54
b(cause)h(serious)g(and)f(har)m(d-to-debug)g(pr)m(oblems.)84
b(Notably)-20 b(,)57 b(the)e(garbage)g(collector)g(may)332
6945 y(r)m(elocate)45 b(an)h(object)e(and)i(invalidate)f
Fp(s48)p 3304 6945 V 65 w(value)h Ft(variables)f(which)f(ar)m(e)h(not)h
(pr)m(otected.)614 7171 y(A)40 b Fp(gc-protection-mismatch)h
Ft(exception)e(is)g(raised)g(if,)h(when)e(a)h(C)g(pr)m(ocedur)m(e)f(r)m
(eturns)332 7397 y(to)46 b(Scheme,)g(the)g(calls)f(to)h
Fp(S48)p 2484 7397 V 65 w(GC)p 2767 7397 V 66 w(PROTECT\(\))g
Ft(have)f(not)h(been)f(matched)g(by)g(an)h(equal)f(num-)332
7622 y(ber)g(of)g(calls)g(to)h Fp(S48)p 1784 7622 V 66
w(GC)p 2068 7622 V 66 w(UNPROTECT\(\))p Ft(.)614 7848
y(Global)f(variables)f(may)h(also)h(be)f(r)m(egister)m(ed)g(with)g(the)
h(garbage)f(collector)-13 b(.)368 8186 y Fl(\017)91 b
Fp(void)h(S48)p 1416 8186 V 65 w(GC)p 1699 8186 V 66
w(PROTECT)p 2528 8186 V 66 w(GLOBAL\()p Fs(value)p Fp(\))332
8524 y(S48)p 670 8524 V 66 w(GC)p 954 8524 V 65 w(PROTECT)p
1782 8524 V 67 w(GLOBAL)53 b Ft(permanently)g(r)m(egisters)h(the)f
(variable)f Fs(value)g Ft(\(an)h(l-value\))e(with)332
8750 y(the)46 b(garbage)f(collector)-13 b(.)56 b(Ther)m(e)45
b(is)h(no)f(way)h(to)f(unr)m(egister)g(the)h(variable.)332
9259 y Fg(7.9.2)198 b(Keeping)49 b(C)g(data)g(structures)h(in)g(the)g
(Scheme)f(heap)332 9612 y Ft(C)68 b(data)g(str)o(uctur)m(es)f(can)g(be)
h(kept)g(in)g(the)g(Scheme)g(heap)g(by)f(embedding)h(them)f(inside)h
(byte)332 9838 y(vectors.)57 b(The)46 b(following)f(macr)m(os)f(can)h
(be)g(used)g(to)h(cr)m(eate)f(and)h(access)f(embedded)g(C)g(objects.)
368 10176 y Fl(\017)91 b Fp(s48)p 888 10176 V 66 w(value)g(S48)p
1917 10176 V 66 w(MAKE)p 2419 10176 V 66 w(VALUE\(type\))2712
b Ft(\(may)45 b(GC\))368 10402 y Fl(\017)91 b Fp(type)546
b(S48)p 1870 10402 V 66 w(EXTRACT)p 2699 10402 V 66 w(VALUE\(s48)p
3746 10402 V 66 w(value,)92 b(type\))368 10628 y Fl(\017)f
Fp(type)h(*)363 b(S48)p 1888 10628 V 66 w(EXTRACT)p 2717
10628 V 66 w(VALUE)p 3328 10628 V 66 w(POINTER\(s48)p
4593 10628 V 66 w(value,)92 b(type\))368 10853 y Fl(\017)f
Fp(void)546 b(S48)p 1870 10853 V 66 w(SET)p 2263 10853
V 66 w(VALUE\(s48)p 3310 10853 V 66 w(value,)91 b(type,)h(value\))398
11191 y(S48)p 736 11191 V 66 w(MAKE)p 1238 11191 V 66
w(VALUE)67 b Ft(makes)f(a)g(byte)h(vector)f(lar)m(ge)g(enough)g(to)h
(hold)f(an)g(object)g(whose)g(type)332 11417 y(is)c Fs(type)p
Ft(.)103 b Fp(S48)p 1324 11417 V 66 w(EXTRACT)p 2153
11417 V 66 w(VALUE)62 b Ft(r)m(eturns)f(the)h(contents)f(of)h(a)f(byte)
g(vector)h(cast)f(to)h Fs(type)p Ft(,)j(and)332 11643
y Fp(S48)p 670 11643 V 66 w(EXTRACT)p 1499 11643 V 66
w(VALUE)p 2110 11643 V 66 w(POINTER)c Ft(r)m(eturns)g(a)g(pointer)g(to)
h(the)f(contents)g(of)g(the)g(byte)g(vector)-13 b(.)3661
12141 y(82)p eop end
%%Page: 83 91
TeXDict begin 83 90 bop 166 1146 a Ft(The)72 b(value)f(r)m(eturned)g
(by)g Fp(S48)p 2440 1146 55 7 v 66 w(EXTRACT)p 3269 1146
V 66 w(VALUE)p 3880 1146 V 66 w(POINTER)h Ft(is)f(valid)h(only)f(until)
g(the)h(next)166 1372 y(garbage)45 b(collection.)448
1599 y Fp(S48)p 786 1599 V 66 w(SET)p 1179 1599 V 66
w(VALUE)h Ft(stor)m(es)f Fp(value)h Ft(into)g(the)g(byte)f(vector)-13
b(.)166 2122 y Fg(7.9.3)198 b(C)49 b(code)h(and)f(heap)f(images)166
2480 y Ft(Scheme)95 b(48)g(uses)g(dumped)f(heap)i(images)e(to)i(r)m
(estor)m(e)f(a)g(pr)m(evious)f(system)h(state.)207 b(The)166
2706 y(Scheme)40 b(48)h(heap)g(is)f(written)h(into)g(a)f(\002le)h(in)f
(a)h(machine-independent)e(and)h(operating-system-)166
2932 y(independent)58 b(format.)91 b(The)57 b(pr)m(ocedur)m(es)g
(described)g(above)f(may)h(be)g(used)g(to)h(cr)m(eate)f(objects)166
3158 y(in)d(the)g(Scheme)g(heap)g(that)h(contain)e(information)h
(speci\002c)f(to)i(the)f(curr)m(ent)f(machine,)j(operat-)166
3383 y(ing)46 b(system,)h(or)f(pr)m(ocess.)60 b(A)46
b(heap)h(image)e(containing)h(such)g(objects)f(may)h(not)h(work)f(corr)
m(ectly)166 3609 y(when)f(r)m(esumed.)448 3837 y(T)-17
b(o)59 b(addr)m(ess)e(this)h(pr)m(oblem,)i(a)e(r)m(ecor)m(d)f(type)h
(may)f(be)g(given)g(a)h(`r)m(esumer)13 b(')56 b(pr)m(ocedur)m(e.)92
b(On)166 4063 y(startup,)50 b(the)f(r)m(esumer)e(pr)m(ocedur)m(e)h(for)
g(a)h(type)g(is)g(applied)g(to)g(each)f(r)m(ecor)m(d)g(of)g(that)h
(type)h(in)e(the)166 4289 y(image)c(being)f(r)m(estarted.)57
b(This)44 b(pr)m(ocedur)m(e)g(can)f(update)i(the)f(r)m(ecor)m(d)f(in)h
(a)g(manner)g(appr)m(opriate)166 4515 y(to)i(the)g(machine,)e
(operating)i(system,)g(or)g(pr)m(ocess)f(used)h(to)g(r)m(esume)e(the)i
(image.)202 4865 y Fl(\017)91 b Fp(\(define-record-resumer)i
Fs(r)m(ecord-type)88 b(pr)m(ocedur)m(e)p Fp(\))166 5216
y(Define-record-resumer)48 b Ft(de\002nes)f Fs(pr)m(ocedur)m(e)p
Ft(,)e(which)g(should)i(accept)f(one)h(ar)m(gument,)e(to)166
5442 y(be)60 b(the)g(r)m(esumer)f(for)h Fs(r)m(ecord-type)m
Ft(.)101 b(The)61 b(or)m(der)f(in)g(which)f(r)m(esumer)g(pr)m(ocedur)m
(es)g(ar)m(e)h(called)g(is)166 5668 y(not)46 b(speci\002ed.)448
5895 y(The)52 b Fs(pr)m(ocedur)m(e)d Ft(ar)m(gument)h(to)h
Fp(define-record-resumer)i Ft(may)e(be)f Fp(#f)p Ft(,)k(in)c(which)g
(case)166 6121 y(r)m(ecor)m(ds)59 b(of)h(the)g(given)f(type)h(ar)m(e)g
(not)g(written)f(out)h(in)g(heap)g(images.)99 b(When)59
b(writing)g(a)h(heap)166 6347 y(image)42 b(any)h(r)m(efer)m(ence)e(to)j
(such)e(a)g(r)m(ecor)m(d)h(is)f(r)m(eplaced)h(by)f(the)h(value)f(of)h
(the)g(r)m(ecor)m(d's)f(\002rst)g(\002eld,)166 6573 y(and)j(an)g
(exception)h(is)g(raised)f(after)g(the)h(image)f(is)g(written.)166
7183 y Fm(7.10)238 b(Using)59 b(Scheme)g(records)h(in)f(C)h(code)166
7610 y Ft(External)45 b(modules)g(can)g(cr)m(eate)g(r)m(ecor)m(ds)g
(and)g(access)g(their)h(slots)g(positionally)-20 b(.)202
7960 y Fl(\017)91 b Fp(s48)p 722 7960 V 66 w(value)g(s48)p
1751 7960 V 66 w(make)p 2253 7960 V 66 w(record\(s48)p
3409 7960 V 66 w(value\))2101 b Ft(\(may)45 b(GC\))202
8186 y Fl(\017)91 b Fp(int)637 b(S48)p 1686 8186 V 66
w(RECORD)p 2406 8186 V 66 w(P\(s48)p 3017 8186 V 65 w(value\))202
8412 y Fl(\017)91 b Fp(s48)p 722 8412 V 66 w(value)g(S48)p
1751 8412 V 66 w(RECORD)p 2471 8412 V 66 w(TYPE\(s48)p
3409 8412 V 66 w(value\))202 8638 y Fl(\017)g Fp(s48)p
722 8638 V 66 w(value)g(S48)p 1751 8638 V 66 w(RECORD)p
2471 8638 V 66 w(REF\(s48)p 3300 8638 V 66 w(value,)h(long\))202
8863 y Fl(\017)f Fp(void)546 b(S48)p 1704 8863 V 66 w(RECORD)p
2424 8863 V 66 w(SET\(s48)p 3253 8863 V 66 w(value,)91
b(long,)h(s48)p 5028 8863 V 65 w(value\))166 9214 y Ft(The)72
b(ar)m(gument)e(to)i Fp(s48)p 1964 9214 V 65 w(make)p
2465 9214 V 66 w(record)g Ft(should)f(be)g(a)g(shar)m(ed)g(binding)f
(whose)h(value)g(is)g(a)166 9440 y(r)m(ecor)m(d)66 b(type.)122
b(In)67 b(C)g(the)g(\002elds)g(of)g(Scheme)f(r)m(ecor)m(ds)g(ar)m(e)h
(only)g(accessible)f(via)g(of)m(fsets,)72 b(with)166
9666 y(the)61 b(\002rst)h(\002eld)f(having)f(of)m(fset)h(zer)m(o,)k
(the)d(second)f(of)m(fset)f(one,)66 b(and)61 b(so)g(forth.)104
b(If)61 b(the)g(or)m(der)g(of)166 9892 y(the)56 b(\002elds)f(is)h
(changed)f(in)g(the)h(Scheme)f(de\002nition)h(of)f(the)h(r)m(ecor)m(d)e
(type)j(the)e(C)h(code)f(must)g(be)166 10117 y(updated)46
b(as)f(well.)448 10345 y(For)h(example,)f(given)h(the)f(following)g(r)m
(ecor)m(d-type)g(de\002nition)497 10731 y Fp(\(define-record-type)111
b(thing)e(:thing)715 10959 y(\(make-thing)h(a)f(b\))715
11187 y(thing?)715 11415 y(\(a)g(thing-a\))715 11643
y(\(b)g(thing-b\)\))3495 12141 y Ft(83)p eop end
%%Page: 84 92
TeXDict begin 84 91 bop 332 1146 a Ft(the)46 b(identi\002er)f
Fp(:thing)h Ft(is)g(bound)e(to)i(the)g(r)m(ecor)m(d)f(type)h(and)f(can)
g(be)g(exported)h(to)g(C:)663 1495 y Fp(\(define-exported-binding)111
b("thing-record-type")g(:thing\))332 1845 y(Thing)46
b Ft(r)m(ecor)m(ds)f(can)g(then)g(be)g(made)g(in)h(C:)663
2195 y Fp(static)109 b(s48_value)881 2420 y(thing_record_type_binding)i
(=)f(S48_FALSE;)663 2872 y(void)f(initialize_things\(void\))663
3098 y Fl(f)881 3324 y Fp
(S48_GC_PROTECT_GLOBAL\(thing_record_type_binding\);)881
3549 y(thing_record_type_binding)i(=)1208 3775 y
(s48_get_imported_binding\("thing-record-type"\);)663
4001 y Fl(g)663 4453 y Fp(s48_value)f(make_thing\(s48_value)h(a,)e
(s48_value)h(b\))663 4679 y Fl(f)881 4904 y Fp(s48_value)g(thing;)881
5130 y(s48_DECLARE_GC_PROTECT\(2\);)881 5582 y(S48_GC_PROTECT_2\(a,)h
(b\);)881 6033 y(thing)f(=)f
(s48_make_record\(thing_record_type_binding\);)881 6259
y(S48_RECORD_SET\(thing,)i(0,)e(a\);)881 6485 y(S48_RECORD_SET\(thing,)
i(1,)e(b\);)881 6937 y(S48_GC_UNPROTECT\(\);)881 7388
y(return)h(thing;)663 7614 y Fl(g)332 7964 y Ft(Note)48
b(that)f(the)h(variables)e Fp(a)h Ft(and)g Fp(b)g Ft(must)g(be)g(pr)m
(otected)h(against)f(the)g(possibility)h(of)f(a)g(garbage)332
8190 y(collection)e(occuring)g(during)g(the)g(call)g(to)h
Fp(s48)p 3656 8190 55 7 v 66 w(make)p 4158 8190 V 66
w(record\(\))p Ft(.)332 8782 y Fm(7.11)238 b(Raising)58
b(exceptions)g(from)h(external)f(code)332 9204 y Ft(The)116
b(following)e(macr)m(os)g(explicitly)h(raise)g(certain)g(err)m(ors,)132
b(immediately)114 b(r)m(eturning)h(to)332 9429 y(Scheme)51
b(48.)75 b(Raising)51 b(an)g(exception)h(performs)f(all)g(necessary)g
(clean-up)f(actions)i(to)g(pr)m(operly)332 9655 y(r)m(eturn)45
b(to)h(Scheme)f(48,)h(including)e(adjusting)h(the)g(stack)h(of)f(pr)m
(otected)h(variables.)368 9972 y Fl(\017)91 b Fp(s48)p
888 9972 V 66 w(raise)p 1499 9972 V 66 w(scheme)p 2219
9972 V 66 w(exception\(int)h(type,)f(int)h(nargs,)f(...\))332
10288 y(s48)p 670 10288 V 66 w(raise)p 1281 10288 V 66
w(scheme)p 2001 10288 V 66 w(exception)54 b Ft(is)g(the)g(base)f(pr)m
(ocedur)m(e)g(for)h(raising)f(exceptions.)82 b Fp(type)332
10514 y Ft(is)58 b(the)f(type)h(of)g(exception,)j(and)c(should)h(be)f
(one)g(of)h(the)f Fp(S48)p 4780 10514 V 66 w(EXCEPTION)p
5827 10514 V 66 w Ft(.)27 b(.)g(.)g(constants)60 b(de-)332
10740 y(\002ned)81 b(in)g Fp(scheme48arch.h)p Ft(.)166
b Fp(nargs)82 b Ft(is)f(the)h(number)e(of)h(additional)g(values)g(to)h
(be)f(in-)332 10966 y(cluded)56 b(in)g(the)h(exception;)62
b(these)57 b(follow)f(the)h Fp(nargs)g Ft(ar)m(gument)e(and)h(should)g
(all)g(have)g(type)332 11191 y Fp(s48)p 670 11191 V 66
w(value)p Ft(.)h Fp(s48)p 1710 11191 V 66 w(raise)p 2321
11191 V 66 w(scheme)p 3041 11191 V 66 w(exception)46
b Ft(never)f(r)m(eturns.)614 11417 y(The)55 b(following)f(pr)m(ocedur)m
(es)g(ar)m(e)g(available)f(for)h(raising)g(particular)g(types)h(of)f
(exceptions.)332 11643 y(Like)46 b Fp(s48)p 1068 11643
V 65 w(raise)p 1678 11643 V 66 w(scheme)p 2398 11643
V 66 w(exception)h Ft(these)e(never)g(r)m(eturn.)3661
12141 y(84)p eop end
%%Page: 85 93
TeXDict begin 85 92 bop 202 1146 a Fl(\017)91 b Fp(s48)p
722 1146 55 7 v 66 w(raise)p 1333 1146 V 66 w(argument)p
2271 1146 V 66 w(type)p 2773 1146 V 66 w(error\(s48)p
3820 1146 V 66 w(value\))202 1372 y Fl(\017)g Fp(s48)p
722 1372 V 66 w(raise)p 1333 1372 V 66 w(argument)p 2271
1372 V 66 w(number)p 2991 1372 V 66 w(error\(int)h(nargs,)f(int)g(min,)
h(int)f(max\))202 1597 y Fl(\017)g Fp(s48)p 722 1597
V 66 w(raise)p 1333 1597 V 66 w(range)p 1944 1597 V 66
w(error\(long)h(value,)f(long)g(min,)h(long)f(max\))202
1823 y Fl(\017)g Fp(s48)p 722 1823 V 66 w(raise)p 1333
1823 V 66 w(closed)p 2053 1823 V 66 w(channel)p 2882
1823 V 66 w(error\(\))202 2049 y Fl(\017)g Fp(s48)p 722
2049 V 66 w(raise)p 1333 2049 V 66 w(os)p 1617 2049 V
65 w(error\(int)h(errno\))202 2275 y Fl(\017)f Fp(s48)p
722 2275 V 66 w(raise)p 1333 2275 V 66 w(out)p 1726 2275
V 66 w(of)p 2010 2275 V 65 w(memory)p 2729 2275 V 66
w(error\(\))166 2597 y Ft(An)48 b(ar)m(gument)e(type)j(err)m(or)e
(indicates)g(that)h(the)f(given)h(value)e(is)i(of)f(the)h(wr)m(ong)f
(type.)64 b(An)47 b(ar)m(gu-)166 2823 y(ment)55 b(number)e(err)m(or)h
(is)h(raised)g(when)f(the)h(number)e(of)i(ar)m(guments,)i
Fp(nargs)p Ft(,)h(should)c(be,)k(but)166 3049 y(isn't,)44
b(between)g Fp(min)g Ft(and)g Fp(max)p Ft(,)h(inclusive.)55
b(Similarly)-20 b(,)44 b(a)g(range)f(err)m(or)h(indicates)f(that)i
Fp(value)f Ft(is)166 3275 y(not)i(between)f(between)g
Fp(min)h Ft(and)f Fp(max)p Ft(,)h(inclusive.)448 3500
y(The)51 b(following)f(macr)m(os)g(raise)g(ar)m(gument)f(type)j(err)m
(ors)e(if)g(their)g(ar)m(gument)g(does)h(not)g(have)166
3726 y(the)j(r)m(equir)m(ed)f(type.)83 b Fp(S48)p 2035
3726 V 66 w(CHECK)p 2646 3726 V 66 w(BOOLEAN)54 b Ft(raises)g(an)g(err)
m(or)f(if)h(its)g(ar)m(gument)f(is)h(neither)g Fp(#t)166
3952 y Ft(or)46 b Fp(#f)p Ft(.)202 4274 y Fl(\017)91
b Fp(void)g(S48)p 1249 4274 V 66 w(CHECK)p 1860 4274
V 66 w(BOOLEAN\(s48)p 3125 4274 V 67 w(value\))202 4500
y Fl(\017)g Fp(void)g(S48)p 1249 4500 V 66 w(CHECK)p
1860 4500 V 66 w(SYMBOL\(s48)p 3016 4500 V 66 w(value\))202
4726 y Fl(\017)g Fp(void)g(S48)p 1249 4726 V 66 w(CHECK)p
1860 4726 V 66 w(PAIR\(s48)p 2798 4726 V 66 w(value\))202
4952 y Fl(\017)g Fp(void)g(S48)p 1249 4952 V 66 w(CHECK)p
1860 4952 V 66 w(STRING\(s48)p 3016 4952 V 66 w(value\))202
5178 y Fl(\017)g Fp(void)g(S48)p 1249 5178 V 66 w(CHECK)p
1860 5178 V 66 w(INTEGER\(s48)p 3125 5178 V 67 w(value\))202
5403 y Fl(\017)g Fp(void)g(S48)p 1249 5403 V 66 w(CHECK)p
1860 5403 V 66 w(CHANNEL\(s48)p 3125 5403 V 67 w(value\))202
5629 y Fl(\017)g Fp(void)g(S48)p 1249 5629 V 66 w(CHECK)p
1860 5629 V 66 w(BYTE)p 2362 5629 V 66 w(VECTOR\(s48)p
3518 5629 V 66 w(value\))202 5855 y Fl(\017)g Fp(void)g(S48)p
1249 5855 V 66 w(CHECK)p 1860 5855 V 66 w(RECORD\(s48)p
3016 5855 V 66 w(value\))202 6081 y Fl(\017)g Fp(void)g(S48)p
1249 6081 V 66 w(CHECK)p 1860 6081 V 66 w(SHARED)p 2580
6081 V 66 w(BINDING\(s48)p 3845 6081 V 67 w(value\))166
6674 y Fm(7.12)238 b(Unsafe)59 b(functions)g(and)h(macros)166
7096 y Ft(All)48 b(of)f(the)g(C)g(pr)m(ocedur)m(es)g(and)g(macr)m(os)f
(described)h(above)g(check)g(that)g(their)g(ar)m(guments)f(have)166
7322 y(the)61 b(appr)m(opriate)h(types)f(and)g(that)g(indexes)g(ar)m(e)
g(in)f(range.)103 b(The)62 b(following)e(pr)m(ocedur)m(es)g(and)166
7548 y(macr)m(os)d(ar)m(e)g(identical)g(to)h(those)h(described)e
(above,)j(except)e(that)g(they)g(do)g(not)g(perform)f(type)166
7773 y(and)c(range)g(checks.)81 b(They)54 b(ar)m(e)f(pr)m(ovided)g(for)
g(the)h(purpose)g(of)f(writing)g(mor)m(e)g(ef)m(\002cient)f(code;)166
7999 y(their)45 b(general)h(use)f(is)g(not)h(r)m(ecommended.)202
8322 y Fl(\017)91 b Fp(char)546 b(S48)p 1704 8322 V 66
w(UNSAFE)p 2424 8322 V 66 w(EXTRACT)p 3253 8322 V 66
w(CHAR\(s48)p 4191 8322 V 66 w(value\))202 8547 y Fl(\017)91
b Fp(char)g(*)364 b(S48)p 1722 8547 V 66 w(UNSAFE)p 2442
8547 V 66 w(EXTRACT)p 3271 8547 V 66 w(STRING\(s48)p
4427 8547 V 66 w(value\))202 8773 y Fl(\017)91 b Fp(long)546
b(S48)p 1704 8773 V 66 w(UNSAFE)p 2424 8773 V 66 w(EXTRACT)p
3253 8773 V 66 w(INTEGER\(s48)p 4518 8773 V 66 w(value\))202
8999 y Fl(\017)91 b Fp(long)546 b(S48)p 1704 8999 V 66
w(UNSAFE)p 2424 8999 V 66 w(EXTRACT)p 3253 8999 V 66
w(DOUBLE\(s48)p 4409 8999 V 66 w(value\))202 9321 y Fl(\017)91
b Fp(long)546 b(S48)p 1704 9321 V 66 w(UNSAFE)p 2424
9321 V 66 w(EXTRACT)p 3253 9321 V 66 w(FIXNUM\(s48)p
4409 9321 V 66 w(value\))202 9547 y Fl(\017)91 b Fp(s48)p
722 9547 V 66 w(value)g(S48)p 1751 9547 V 66 w(UNSAFE)p
2471 9547 V 66 w(ENTER)p 3082 9547 V 66 w(FIXNUM\(long\))202
9869 y Fl(\017)g Fp(s48)p 722 9869 V 66 w(value)g(S48)p
1751 9869 V 66 w(UNSAFE)p 2471 9869 V 66 w(CAR\(s48)p
3300 9869 V 66 w(value\))202 10095 y Fl(\017)g Fp(s48)p
722 10095 V 66 w(value)g(S48)p 1751 10095 V 66 w(UNSAFE)p
2471 10095 V 66 w(CDR\(s48)p 3300 10095 V 66 w(value\))202
10321 y Fl(\017)g Fp(void)546 b(S48)p 1704 10321 V 66
w(UNSAFE)p 2424 10321 V 66 w(SET)p 2817 10321 V 65 w(CAR\(s48)p
3645 10321 V 67 w(value,)91 b(s48)p 4784 10321 V 66 w(value\))202
10547 y Fl(\017)g Fp(void)546 b(S48)p 1704 10547 V 66
w(UNSAFE)p 2424 10547 V 66 w(SET)p 2817 10547 V 65 w(CDR\(s48)p
3645 10547 V 67 w(value,)91 b(s48)p 4784 10547 V 66 w(value\))202
10869 y Fl(\017)g Fp(long)546 b(S48)p 1704 10869 V 66
w(UNSAFE)p 2424 10869 V 66 w(VECTOR)p 3144 10869 V 66
w(LENGTH\(s48)p 4300 10869 V 66 w(value\))202 11095 y
Fl(\017)91 b Fp(s48)p 722 11095 V 66 w(value)g(S48)p
1751 11095 V 66 w(UNSAFE)p 2471 11095 V 66 w(VECTOR)p
3191 11095 V 66 w(REF\(s48)p 4020 11095 V 66 w(value,)h(long\))202
11321 y Fl(\017)f Fp(void)546 b(S48)p 1704 11321 V 66
w(UNSAFE)p 2424 11321 V 66 w(VECTOR)p 3144 11321 V 66
w(SET\(s48)p 3973 11321 V 66 w(value,)91 b(long,)h(s48)p
5748 11321 V 65 w(value\))202 11643 y Fl(\017)f Fp(long)546
b(S48)p 1704 11643 V 66 w(UNSAFE)p 2424 11643 V 66 w(STRING)p
3144 11643 V 66 w(LENGTH\(s48)p 4300 11643 V 66 w(value\))3495
12141 y Ft(85)p eop end
%%Page: 86 94
TeXDict begin 86 93 bop 368 1146 a Fl(\017)91 b Fp(char)546
b(S48)p 1870 1146 55 7 v 66 w(UNSAFE)p 2590 1146 V 66
w(STRING)p 3310 1146 V 66 w(REF\(s48)p 4139 1146 V 66
w(value,)91 b(long\))368 1372 y Fl(\017)g Fp(void)546
b(S48)p 1870 1372 V 66 w(UNSAFE)p 2590 1372 V 66 w(STRING)p
3310 1372 V 66 w(SET\(s48)p 4139 1372 V 66 w(value,)91
b(long,)h(char\))368 1714 y Fl(\017)f Fp(s48)p 888 1714
V 66 w(value)g(S48)p 1917 1714 V 66 w(UNSAFE)p 2637 1714
V 66 w(SYMBOL)p 3357 1714 V 66 w(TO)p 3641 1714 V 66
w(STRING\(s48)p 4797 1714 V 66 w(value\))368 2056 y Fl(\017)g
Fp(long)546 b(S48)p 1870 2056 V 66 w(UNSAFE)p 2590 2056
V 66 w(BYTE)p 3092 2056 V 66 w(VECTOR)p 3812 2056 V 66
w(LENGTH\(s48)p 4968 2056 V 66 w(value\))368 2281 y Fl(\017)91
b Fp(char)546 b(S48)p 1870 2281 V 66 w(UNSAFE)p 2590
2281 V 66 w(BYTE)p 3092 2281 V 66 w(VECTOR)p 3812 2281
V 66 w(REF\(s48)p 4641 2281 V 66 w(value,)91 b(long\))368
2507 y Fl(\017)g Fp(void)546 b(S48)p 1870 2507 V 66 w(UNSAFE)p
2590 2507 V 66 w(BYTE)p 3092 2507 V 66 w(VECTOR)p 3812
2507 V 66 w(SET\(s48)p 4641 2507 V 66 w(value,)91 b(long,)h(int\))368
2849 y Fl(\017)f Fp(s48)p 888 2849 V 66 w(value)g(S48)p
1917 2849 V 66 w(UNSAFE)p 2637 2849 V 66 w(SHARED)p 3357
2849 V 66 w(BINDING)p 4186 2849 V 66 w(REF\(s48)p 5015
2849 V 66 w(value)h(s)p 5827 2849 V 65 w(b\))368 3075
y Fl(\017)f Fp(int)637 b(S48)p 1852 3075 V 66 w(UNSAFE)p
2572 3075 V 66 w(SHARED)p 3292 3075 V 66 w(BINDING)p
4121 3075 V 66 w(P\(x\))368 3301 y Fl(\017)91 b Fp(int)637
b(S48)p 1852 3301 V 66 w(UNSAFE)p 2572 3301 V 66 w(SHARED)p
3292 3301 V 66 w(BINDING)p 4121 3301 V 66 w(IS)p 4405
3301 V 65 w(IMPORT)p 5124 3301 V 66 w(P\(s48)p 5735 3301
V 66 w(value)92 b(s)p 6547 3301 V 65 w(b\))368 3527 y
Fl(\017)f Fp(s48)p 888 3527 V 66 w(value)g(S48)p 1917
3527 V 66 w(UNSAFE)p 2637 3527 V 66 w(SHARED)p 3357 3527
V 66 w(BINDING)p 4186 3527 V 66 w(NAME\(s48)p 5124 3527
V 66 w(value)h(s)p 5936 3527 V 65 w(b\))368 3753 y Fl(\017)f
Fp(void)546 b(S48)p 1870 3753 V 66 w(UNSAFE)p 2590 3753
V 66 w(SHARED)p 3310 3753 V 66 w(BINDING)p 4139 3753
V 66 w(SET\(s48)p 4968 3753 V 66 w(value)91 b(s)p 5779
3753 V 66 w(b,)g(s48)p 6481 3753 V 66 w(value)g(value\))368
4095 y Fl(\017)g Fp(s48)p 888 4095 V 66 w(value)g(S48)p
1917 4095 V 66 w(UNSAFE)p 2637 4095 V 66 w(RECORD)p 3357
4095 V 66 w(TYPE\(s48)p 4295 4095 V 66 w(value\))368
4320 y Fl(\017)g Fp(s48)p 888 4320 V 66 w(value)g(S48)p
1917 4320 V 66 w(UNSAFE)p 2637 4320 V 66 w(RECORD)p 3357
4320 V 66 w(REF\(s48)p 4186 4320 V 66 w(value,)h(long\))368
4546 y Fl(\017)f Fp(void)546 b(S48)p 1870 4546 V 66 w(UNSAFE)p
2590 4546 V 66 w(RECORD)p 3310 4546 V 66 w(SET\(s48)p
4139 4546 V 66 w(value,)91 b(long,)h(s48)p 5914 4546
V 65 w(value\))368 4888 y Fl(\017)f Fp(type)546 b(S48)p
1870 4888 V 66 w(UNSAFE)p 2590 4888 V 66 w(EXTRACT)p
3419 4888 V 66 w(VALUE\(s48)p 4466 4888 V 66 w(value,)92
b(type\))368 5114 y Fl(\017)f Fp(type)h(*)363 b(S48)p
1888 5114 V 66 w(UNSAFE)p 2608 5114 V 66 w(EXTRACT)p
3437 5114 V 66 w(VALUE)p 4048 5114 V 66 w(POINTER\(s48)p
5313 5114 V 66 w(value,)92 b(type\))368 5340 y Fl(\017)f
Fp(void)546 b(S48)p 1870 5340 V 66 w(UNSAFE)p 2590 5340
V 66 w(SET)p 2983 5340 V 66 w(VALUE\(s48)p 4030 5340
V 66 w(value,)91 b(type,)h(value\))3661 12141 y Ft(86)p
eop end
%%Page: 87 95
TeXDict begin 87 94 bop 166 2400 a Fo(Chapter)87 b(8)166
3239 y Fr(Access)105 b(to)e(POSIX)166 4138 y Ft(This)41
b(chapter)g(describes)g(Scheme)f(48's)h(interface)f(to)i(the)f(POSIX)h
(C)f(calls)f([1].)54 b(Scheme)41 b(versions)166 4364
y(of)36 b(most)g(of)f(the)h(functions)f(in)g(POSIX)i(ar)m(e)e(pr)m
(ovided.)54 b(Both)36 b(the)g(interface)f(and)g(implementation)166
4590 y(ar)m(e)58 b(new)g(and)h(ar)m(e)f(likely)h(to)g(change)f(in)g
(futur)m(e)g(r)m(eleases.)96 b(Section)59 b(8.10)g(lists)g(which)e
(Scheme)166 4816 y(functions)45 b(call)f(which)h(C)g(functions.)448
5051 y(Scheme)70 b(48's)f(POSIX)i(interface)e(will)g(likely)h(change)g
(signi\002cantly)f(in)h(the)g(futur)m(e.)129 b(The)166
5276 y(implementation)45 b(is)h(new)f(and)g(may)g(have)g(signi\002cant)
g(bugs.)448 5511 y(The)h(POSIX)g(bindings)f(ar)m(e)g(available)f(in)h
(several)h(str)o(uctur)m(es:)1361 5991 y Fp(posix-processes)528
b Ft(fork,)45 b(exec,)h(and)f(friends)1361 6216 y Fp
(posix-process-data)201 b Ft(information)44 b(about)h(pr)m(ocesses)1361
6442 y Fp(posix-files)964 b Ft(\002les)45 b(and)g(dir)m(ectories)1361
6668 y Fp(posix-i/o)1182 b Ft(operations)46 b(on)f(ports)1361
6894 y Fp(posix-time)1073 b Ft(time)45 b(functions)1361
7120 y Fp(posix-users)964 b Ft(users)45 b(and)g(gr)m(oups)1361
7346 y Fp(posix-regexps)746 b Ft(r)m(egular)44 b(expr)m(ession)h
(matching)1361 7571 y Fp(posix)1618 b Ft(all)45 b(of)g(the)h(above)448
8032 y(Scheme)41 b(48's)g(POSIX)g(interface)g(dif)m(fers)f(fr)m(om)g
(Scsh's)g([10,)h(11])g(in)g(several)f(ways.)55 b(The)42
b(inter)m(-)166 8258 y(face)48 b(her)m(e)h(lacks)f(Scsh's)h(high-level)
e(constr)o(ucts)h(and)h(utilities,)h(such)e(as)h(the)g(pr)m(ocess)g
(notation,)166 8484 y Fp(awk)57 b Ft(pr)m(ocedur)m(e,)j(and)d(parsing)g
(utilities.)91 b(Scheme)57 b(48)g(uses)g(distinct)g(types)h(for)f(some)
g(values)166 8710 y(that)c(Scsh)g(leaves)f(as)h(symbols)f(or)g(unboxed)
g(integers;)57 b(these)c(include)f(\002le)g(types,)k(\002le)d(modes,)
166 8936 y(and)f(user)h(and)f(gr)m(oup)g(ids.)79 b(Many)52
b(of)g(the)h(names)f(and)g(other)h(interface)f(details)h(ar)m(e)f(dif)m
(fer)m(ent,)166 9162 y(as)45 b(well.)166 9814 y Fm(8.1)238
b(Process)60 b(primitives)166 10254 y Ft(The)44 b(pr)m(ocedur)m(es)f
(described)g(in)h(this)f(section)h(contr)m(ol)g(the)g(cr)m(eation)f(of)
g(pr)m(ocesses)h(and)g(the)f(exe-)166 10480 y(cution)i(of)g(pr)m
(ograms.)57 b(They)46 b(ar)m(e)f(in)g(the)g(str)o(uctur)m(es)g
Fp(posix-process)h Ft(and)g Fp(posix)p Ft(.)166 11045
y Fg(8.1.1)198 b(Process)50 b(creation)f(and)g(termination)202
11417 y Fl(\017)91 b Fp(\(fork\))h Fl(!)e Fs(pr)m(ocess-id)f(or)h
Fp(#f)202 11643 y Fl(\017)h Fp(\(fork-and-forget)i Fs(thunk)q
Fp(\))3495 12141 y Ft(87)p eop end
%%Page: 88 96
TeXDict begin 88 95 bop 332 1146 a Fp(Fork)49 b Ft(cr)m(eates)g(a)f
(new)g(child)g(pr)m(ocess)h(and)g(r)m(eturns)f(the)g(child's)g(pr)m
(ocess-id)g(in)h(the)g(par)m(ent)f(and)332 1372 y Fp(#f)i
Ft(in)g(the)g(child.)70 b Fp(Fork-and-forget)52 b Ft(calls)d
Fs(thunk)h Ft(in)g(a)g(new)f(pr)m(ocess;)k(no)d(pr)m(ocess-id)g(is)g(r)
m(e-)332 1597 y(turned.)65 b Fp(Fork-and-forget)49 b
Ft(uses)f(an)g(intermediate)g(pr)m(ocess)g(to)g(avoid)g(cr)m(eating)g
(a)g(zombie)332 1823 y(pr)m(ocess.)368 2167 y Fl(\017)91
b Fp(\(process-id?)103 b Fs(x)p Fp(\))91 b Fl(!)g Fs(boolean)368
2393 y Fl(\017)g Fp(\(process-id=?)103 b Fs(pr)m(ocess-id0)88
b(pr)m(ocess-id1)p Fp(\))h Fl(!)h Fs(boolean)368 2618
y Fl(\017)h Fp(\(process-id->integer)i Fs(pr)m(ocess-id)p
Fp(\))88 b Fl(!)j Fs(integer)368 2844 y Fl(\017)g Fp
(\(integer->process-id)i Fs(integer)p Fp(\))c Fl(!)i
Fs(pr)m(ocess-id)332 3188 y Fp(Process-id?)233 b Ft(is)104
b(a)g(pr)m(edicate)f(for)h(pr)m(ocess-ids,)119 b Fp(process-id=?)233
b Ft(compar)m(es)103 b(two)332 3414 y(to)96 b(see)f(if)g(they)g(ar)m(e)
g(the)g(same,)108 b(and)95 b Fp(process-id-uid)h Ft(r)m(eturns)f(the)g
(actual)f(Unix)i(id.)332 3639 y Fp(Process-id->integer)69
b Ft(and)f Fp(integer->process-id)h Ft(convert)f(pr)m(ocess)f(ids)h(to)
g(and)332 3865 y(fr)m(om)44 b(integers.)368 4209 y Fl(\017)91
b Fp(\(process-id-exit-status)i Fs(pr)m(ocess-id)p Fp(\))c
Fl(!)h Fs(integer)f(or)i Fp(#f)368 4435 y Fl(\017)g Fp
(\(process-id-terminating-signal)j Fs(pr)m(ocess-id)p
Fp(\))88 b Fl(!)j Fs(signal)e(or)i Fp(#f)368 4660 y Fl(\017)g
Fp(\(wait-for-child-process)i Fs(pr)m(ocess-id)p Fp(\))332
5004 y Ft(If)83 b(a)g(pr)m(ocess)g(terminates)f(normally)h
Fp(process-id-exit-status)h Ft(will)f(r)m(eturn)f(its)h(exit)332
5230 y(status.)290 b(If)122 b(the)h(pr)m(ocess)g(is)g(still)g(r)o
(unning)f(or)h(was)f(terminated)h(by)g(a)f(signal)h(then)332
5456 y Fp(process-id-exit-status)75 b Ft(will)e(r)m(eturn)f
Fp(#f)p Ft(.)140 b(Similarly)-20 b(,)80 b(if)73 b(a)g(child)g(pr)m
(ocess)g(was)g(ter)m(-)332 5681 y(minated)102 b(by)f(a)h(signal)g
Fp(process-id-terminating-signal)j Ft(will)c(r)m(eturn)g(that)h(sig-)
332 5907 y(nal)107 b(and)g(will)f(r)m(eturn)h Fp(#f)g
Ft(if)g(the)g(pr)m(ocess)g(is)g(still)h(r)o(unning)d(or)j(terminated)f
(normally)-20 b(.)332 6133 y Fp(Wait-for-child-process)70
b Ft(blocks)d(until)g(the)h(child)g(pr)m(ocess)f(terminates.)124
b(Scheme)67 b(48)332 6359 y(may)j(r)m(eap)g(child)f(pr)m(ocesses)h
(befor)m(e)g(the)g(user)g(r)m(equests)f(their)h(exit)g(status,)77
b(but)70 b(it)g(does)h(not)332 6585 y(always)45 b(do)h(so.)368
6928 y Fl(\017)91 b Fp(\(exit)h Fs(status)p Fp(\))332
7272 y Ft(T)-17 b(erminates)46 b(the)f(curr)m(ent)g(pr)m(ocess)g(with)g
(the)h(integer)g Fs(status)d Ft(as)j(its)g(exit)f(status.)332
7784 y Fg(8.1.2)198 b Ff(Exec)368 8138 y Fl(\017)91 b
Fp(\(exec)h Fs(pr)m(ogram-name)d(ar)m(g0)h(.)27 b(.)g(.)g
Fp(\))368 8363 y Fl(\017)91 b Fp(\(exec-with-environment)i
Fs(pr)m(ogram-name)d(env)g(ar)m(g0)g(.)27 b(.)g(.)g Fp(\))368
8589 y Fl(\017)91 b Fp(\(exec-file)h Fs(\002lename)e(ar)m(g0)g(.)27
b(.)g(.)g Fp(\))368 8815 y Fl(\017)91 b Fp
(\(exec-file-with-environment)j Fs(\002lename)c(env)g(ar)m(g0)g(.)27
b(.)g(.)g Fp(\))368 9041 y Fl(\017)91 b Fp(\(exec-with-alias)i
Fs(name)e(lookup?)100 b(maybe-env)90 b(ar)m(guments)p
Fp(\))332 9384 y Ft(All)73 b(of)f(these)g(r)m(eplace)g(the)g(curr)m
(ent)f(pr)m(ogram)h(with)g(a)g(new)f(one.)138 b(They)72
b(dif)m(fer)f(in)h(how)g(the)332 9610 y(new)d(pr)m(ogram)f(is)h(found,)
75 b(what)69 b(its)g(envir)m(onment)f(is,)75 b(and)69
b(what)g(ar)m(guments)f(it)h(is)g(passed.)332 9836 y
Fp(Exec)55 b Ft(and)g Fp(exec-with-environment)i Ft(look)e(up)g(the)g
(new)f(pr)m(ogram)h(in)f(the)h(sear)m(ch)f(path,)332
10062 y(while)68 b Fp(exec-file)i Ft(and)f Fp
(exec-file-with-environment)i Ft(execute)e(a)g(particular)f(\002le.)332
10288 y(The)46 b(envir)m(onment)f(is)g(either)h(inherited)g(fr)m(om)e
(the)i(curr)m(ent)f(pr)m(ocess)h(\()p Fp(exec)f Ft(and)h
Fp(exec-file)p Ft(\))332 10514 y(or)d(given)g(as)g(an)f(ar)m(gument)g
(\()p Fp(...-with-environment)p Ft(\).)57 b Fs(Pr)m(ogram-name)41
b Ft(and)i Fs(\002lename)f Ft(and)332 10739 y(any)55
b Fs(ar)m(g)925 10766 y Fd(i)1036 10739 y Ft(should)h(be)f(strings.)87
b Fs(Env)55 b Ft(should)h(be)f(a)g(list)h(of)f(strings)h(of)f(the)h
(form)e Fp(")p Fs(name)p Fp(=)p Fs(value)p Fp(")p Ft(.)332
10965 y(The)40 b(\002rst)g(four)g(pr)m(ocedur)m(es)f(add)h(their)g
(\002rst)g(ar)m(gument,)g Fs(pr)m(ogram-name)e Ft(or)i
Fs(\002lename)p Ft(,)h(befor)m(e)e(the)332 11191 y Fs(ar)m(g0)45
b(.)27 b(.)g(.)85 b Ft(ar)m(guments.)614 11417 y Fp(Exec-with-alias)48
b Ft(is)d(an)h(omnibus)f(pr)m(ocedur)m(e)g(that)h(subsumes)f(the)h
(other)g(four)-13 b(.)57 b Fs(Name)332 11643 y Ft(is)51
b(looked)h(up)g(in)f(the)g(sear)m(ch)g(path)g(if)g Fs(lookup?)73
b Ft(is)51 b(tr)o(ue)g(and)g(is)g(used)g(as)h(a)f(\002lename)g
(otherwise.)3661 12141 y(88)p eop end
%%Page: 89 97
TeXDict begin 89 96 bop 166 1146 a Fs(Maybe-env)52 b
Ft(is)i(either)g(a)g(list)g(of)g(strings)g(for)f(the)h(envir)m(onment)f
(of)h(the)g(new)f(pr)m(ogram)g(or)h Fp(#f)g Ft(in)166
1372 y(which)37 b(case)h(the)h(new)f(pr)m(ogram)f(inherits)h(its)h
(envir)m(onment)e(fr)m(om)g(the)i(curr)m(ent)e(one.)55
b Fs(Ar)m(guments)166 1597 y Ft(should)45 b(be)f(a)g(list)h(of)g
(strings;)g(unlike)f(with)h(the)g(other)g(four)e(pr)m(ocedur)m(es,)i
Fs(name)g Ft(is)g(not)g(added)f(to)166 1823 y(this)i(list)f(\(hence)g
Fp(-with-alias)p Ft(\).)166 3282 y Fm(8.2)238 b(Signals)166
3988 y Ft(Ther)m(e)49 b(ar)m(e)g(two)h(varieties)f(of)g(signals)h
(available,)f Fs(named)h Ft(and)f Fs(anonymous)p Ft(.)68
b(A)50 b(named)f(signal)g(is)166 4214 y(one)d(for)g(which)e(we)i(have)f
(a)h(symbolic)f(name,)h(such)f(as)h Fp(kill)g Ft(or)g
Fp(pipe)p Ft(.)59 b(Anonymous)46 b(signals,)166 4440
y(for)e(which)g(we)g(only)h(have)f(the)h(curr)m(ent)e(operating)i
(system's)g(signal)f(number)-13 b(,)43 b(have)h(no)h(mean-)166
4666 y(ing)i(in)g(other)h(operating)f(systems.)63 b(Named)47
b(signals)g(pr)m(eserve)g(their)g(meaning)g(in)g(image)g(\002les.)166
4891 y(Not)41 b(all)f(named)g(signals)h(ar)m(e)f(available)f(fr)m(om)g
(all)h(OS's)h(and)f(ther)m(e)g(may)g(be)g(multiple)g(names)g(for)166
5117 y(a)45 b(single)h(OS)g(signal)f(number)-13 b(.)202
6021 y Fl(\017)91 b Fp(\(signal)h Fs(signal-name)p Fp(\))43
b Fl(!)j Fs(signal)3512 b Ft(syntax)202 6247 y Fl(\017)91
b Fp(\(name->signal)h Fs(symbol)p Fp(\))f Fl(!)g Fs(signal)e(or)h
Fp(#f)202 6472 y Fl(\017)h Fp(\(integer->signal)i Fs(integer)p
Fp(\))c Fl(!)i Fs(signal)202 6698 y Fl(\017)g Fp(\(signal?)103
b Fs(x)p Fp(\))91 b Fl(!)f Fs(boolean)202 6924 y Fl(\017)h
Fp(\(signal-name)h Fs(signal)p Fp(\))e Fl(!)g Fs(symbol)h(or)f
Fp(#f)202 7150 y Fl(\017)h Fp(\(signal-os-number)i Fs(signal)p
Fp(\))c Fl(!)i Fs(integer)202 7376 y Fl(\017)g Fp(\(signal=?)103
b Fs(signal0)89 b(signal1)p Fp(\))h Fl(!)g Fs(boolean)166
8279 y Ft(The)154 b(syntax)g Fp(signal)h Ft(r)m(eturns)e(a)h(\(named\))
e(signal)i(associated)g(with)g Fs(signal-name)p Ft(.)166
8505 y Fp(Name->signal)44 b Ft(r)m(eturns)d(a)h(\(named\))f(signal)i
(or)f Fp(#f)h Ft(if)e(the)i(the)g(signal)f Fs(name)g
Ft(is)g(not)h(supported)166 8731 y(by)49 b(the)g(operating)h(system.)69
b(The)49 b(signal)g(r)m(eturned)g(by)g Fp(integer->signal)h
Ft(is)g(a)f(named)f(sig-)166 8957 y(nal)39 b(if)h Fs(integer)e
Ft(corr)m(esponds)h(to)i(a)e(named)g(signal)h(in)f(the)h(curr)m(ent)f
(operating)h(system;)i(otherwise)166 9182 y(it)61 b(r)m(eturns)f(an)h
(anonymous)f(signal.)102 b Fp(Signal-name)62 b Ft(r)m(eturns)e(a)h
(symbol)f(if)g Fs(signal)g Ft(is)h(named)166 9408 y(and)48
b Fp(#f)f Ft(if)h(it)g(is)f(anonymous.)63 b Fp(Signal=?)h
Ft(r)m(eturns)47 b Fp(#t)h Ft(if)f Fs(signal0)g Ft(and)g
Fs(signal1)f Ft(have)i(the)f(same)166 9634 y(operating)f(system)g
(number)d(and)j Fp(#f)f Ft(if)g(they)h(do)g(not.)166
11005 y Fg(8.2.1)198 b(POSIX)48 b(signals)166 11643 y
Ft(The)e(following)f(lists)g(the)h(names)f(of)g(the)h(POSIX)g(signals.)
3495 12141 y(89)p eop end
%%Page: 90 98
TeXDict begin 90 97 bop 540 1121 a Fp(abrt)200 b Ft(abort)45
b(-)g(abnormal)f(termination)i(\(as)f(by)g(abort\(\)\))540
1347 y Fp(alrm)200 b Ft(alarm)45 b(-)g(timeout)g(signal)g(\(as)g(by)g
(alarm\(\)\))540 1573 y Fp(fpe)309 b Ft(\003oating)45
b(point)h(exception)540 1799 y Fp(hup)309 b Ft(hangup)45
b(-)g(hangup)g(on)h(contr)m(olling)f(terminal)f(or)i(death)f(of)h
(contr)m(olling)f(pr)m(ocess)540 2024 y Fp(ill)309 b
Ft(illegal)45 b(instr)o(uction)540 2250 y Fp(int)309
b Ft(interr)o(upt)45 b(-)g(interaction)g(attention)540
2476 y Fp(kill)200 b Ft(kill)45 b(-)g(termination)g(signal,)h(cannot)f
(be)g(caught)g(or)h(ignor)m(ed)540 2702 y Fp(pipe)200
b Ft(pipe)46 b(-)f(write)g(on)h(a)f(pipe)h(with)f(no)h(r)m(eaders)540
2928 y Fp(quit)200 b Ft(quit)45 b(-)g(interaction)g(termination)540
3154 y Fp(segv)200 b Ft(segmentation)46 b(violation)f(-)g(invalid)g
(memory)g(r)m(efer)m(ence)540 3379 y Fp(term)200 b Ft(termination)45
b(-)g(termination)g(signal)540 3605 y Fp(usr1)200 b Ft(user1)45
b(-)g(for)g(use)g(by)g(applications)540 3831 y Fp(usr2)200
b Ft(user2)45 b(-)g(for)g(use)g(by)g(applications)540
4057 y Fp(chld)200 b Ft(child)45 b(-)g(child)g(pr)m(ocess)g(stopped)i
(or)f(terminated)540 4283 y Fp(cont)200 b Ft(continue)45
b(-)g(continue)g(if)g(stopped)540 4508 y Fp(stop)200
b Ft(stop)46 b(-)f(cannot)h(be)f(caught)g(or)g(ignor)m(ed)540
4734 y Fp(tstp)200 b Ft(interactive)45 b(stop)540 4960
y Fp(ttin)200 b Ft(r)m(ead)45 b(fr)m(om)f(contr)m(ol)i(terminal)e
(attempted)j(by)e(backgr)m(ound)f(pr)m(ocess)540 5186
y Fp(ttou)200 b Ft(write)45 b(to)h(contr)m(ol)f(terminal)g(attempted)h
(by)g(backgr)m(ound)e(pr)m(ocess)540 5412 y Fp(bus)309
b Ft(bus)45 b(err)m(or)g(-)g(access)g(to)h(unde\002ned)f(portion)h(of)f
(memory)332 5916 y Fg(8.2.2)198 b(Other)49 b(signals)332
6270 y Ft(The)62 b(following)f(lists)g(the)h(names)f(of)g(the)g
(non-POSIX)h(signals)f(that)h(the)f(system)h(is)f(curr)m(ently)332
6496 y(awar)m(e)45 b(of.)1860 7006 y Fp(trap)417 b Ft(trace)46
b(or)f(br)m(eakpoint)g(trap)1860 7231 y Fp(iot)526 b
Ft(IOT)47 b(trap)e(-)g(a)h(synonym)f(for)g(ABR)-7 b(T)1860
7457 y Fp(emt)1860 7683 y(sys)526 b Ft(bad)45 b(ar)m(gument)g(to)h(r)m
(outine)f(\(SVID\))1860 7909 y Fp(stkflt)199 b Ft(stack)46
b(fault)f(on)g(copr)m(ocessor)1860 8135 y Fp(urg)526
b Ft(ur)m(gent)45 b(condition)h(on)f(socket)h(\(4.2)g(BSD\))1860
8360 y Fp(io)635 b Ft(I/O)46 b(now)f(possible)h(\(4.2)f(BSD\))1860
8586 y Fp(poll)417 b Ft(A)46 b(synonym)g(for)f(SIGIO)h(\(System)f(V\))
1860 8812 y Fp(cld)526 b Ft(A)46 b(synonym)g(for)f(SIGCHLD)1860
9038 y Fp(xcpu)417 b Ft(CPU)46 b(time)f(limit)g(exceeded)h(\(4.2)f
(BSD\))1860 9264 y Fp(xfsz)417 b Ft(File)46 b(size)f(limit)g(exceeded)h
(\(4.2)f(BSD\))1860 9490 y Fp(vtalrm)199 b Ft(V)-10 b(irtual)46
b(alarm)e(clock)h(\(4.2)h(BSD\))1860 9715 y Fp(prof)417
b Ft(Pr)m(o\002le)46 b(alarm)e(clock)1860 9941 y Fp(pwr)526
b Ft(Power)46 b(failur)m(e)e(\(System)h(V\))1860 10167
y Fp(info)417 b Ft(A)46 b(synonym)g(for)f(SIGPWR)1860
10393 y Fp(lost)417 b Ft(File)46 b(lock)f(lost)1860 10619
y Fp(winch)308 b Ft(W)-10 b(indow)45 b(r)m(esize)h(signal)f(\(4.3)g
(BSD,)h(Sun\))1860 10845 y Fp(unused)199 b Ft(Unused)46
b(signal)3661 12141 y(90)p eop end
%%Page: 91 99
TeXDict begin 91 98 bop 166 1146 a Fg(8.2.3)198 b(Sending)48
b(signals)202 1506 y Fl(\017)91 b Fp(\(signal-process)h
Fs(pr)m(ocess-id)d(signal)p Fp(\))166 1872 y Ft(Send)46
b Fs(signal)e Ft(to)i(the)g(pr)m(ocess)f(corr)m(esponding)g(to)h
Fs(pr)m(ocess-id)p Ft(.)166 2418 y Fg(8.2.4)198 b(Receiving)49
b(signals)166 2784 y Ft(Signals)36 b(r)m(eceived)e(by)h(the)h(Scheme)f
(pr)m(ocess)h(can)f(be)g(obtained)g(via)g(one)h(or)f(mor)m(e)g
(signal-queues.)166 3009 y(Each)72 b(signal)h(queue)f(has)g(a)h(list)g
(of)f(monitor)m(ed)h(signals)f(and)h(a)g(queue)f(of)g(r)m(eceived)g
(signals)166 3235 y(that)64 b(have)f(yet)h(to)g(be)f(r)m(ead)g(fr)m(om)
f(the)i(signal-queue.)109 b(When)63 b(the)h(Scheme)f(pr)m(ocess)h(r)m
(eceives)166 3461 y(a)51 b(signal)g(that)g(signal)f(is)h(added)h(to)f
(the)g(r)m(eceived-signal)f(queues)g(of)h(all)g(signal-queues)e(which)
166 3687 y(ar)m(e)c(curr)m(ently)f(monitoring)i(that)f(particular)g
(signal.)202 4053 y Fl(\017)91 b Fp(\(make-signal-queue)i
Fs(signals)p Fp(\))c Fl(!)i Fs(signal-queue)202 4279
y Fl(\017)g Fp(\(signal-queue?)103 b Fs(x)p Fp(\))91
b Fl(!)g Fs(boolean)202 4504 y Fl(\017)g Fp
(\(signal-queue-monitored-signals)j Fs(signal-queue)p
Fp(\))89 b Fl(!)i Fs(list)e(of)h(signals)202 4730 y Fl(\017)h
Fp(\(dequeue-signal!)103 b Fs(signal-queue)p Fp(\))89
b Fl(!)i Fs(signal)202 4956 y Fl(\017)g Fp(\(maybe-dequeue-signal!)104
b Fs(queue-queue)p Fp(\))90 b Fl(!)h Fs(signal)e(or)i
Fp(#f)166 5322 y(Make-signal-queue)126 b Ft(r)m(eturns)d(a)h(new)f
(signal-queue)g(that)h(will)f(monitor)h(the)g(sig-)166
5548 y(nals)116 b(in)g(the)g(list)h Fs(signals)p Ft(.)267
b Fp(Signal-queue?)j Ft(is)116 b(a)g(pr)m(edicate)g(for)g(signal)g
(queues.)166 5774 y Fp(Signal-queue-monitored-signals)68
b Ft(r)m(eturns)d(a)g(list)g(of)g(the)h(signals)f(curr)m(ently)f(mon-)
166 6000 y(itor)m(ed)58 b(by)f Fs(signal-queue)p Ft(.)92
b Fp(Dequeue-signal!)i Ft(and)58 b Fp(maybe-dequeue-signal)h
Ft(both)f(r)m(e-)166 6225 y(turn)c(the)g(next)g(r)m(eceived-but-unr)m
(ead)d(signal)j(fr)m(om)f Fs(signal-queue)p Ft(.)80 b(If)54
b Fs(signal-queue)p Ft('s)e(queue)h(of)166 6451 y(signals)59
b(is)g(empty)g Fp(dequeue-signal!)98 b Ft(blocks)59 b(until)f(an)h
(appr)m(opriate)h(signal)e(is)h(r)m(eceived.)166 6677
y Fp(Maybe-dequeue-signal!)f Ft(does)46 b(not)g(block;)g(it)f(r)m
(eturns)g Fp(#f)h Ft(instead.)448 6909 y(Ther)m(e)66
b(is)g(a)g(bug)f(in)h(the)g(curr)m(ent)f(system)h(that)g(causes)g(an)f
(err)m(oneous)h(deadlock)g(err)m(or)g(if)166 7135 y(thr)m(eads)56
b(ar)m(e)g(blocked)g(waiting)g(for)g(signals)g(and)g(no)h(other)f(thr)m
(eads)g(ar)m(e)g(available)f(to)i(r)o(un.)89 b(A)166
7360 y(work)71 b(ar)m(ound)f(is)h(to)h(cr)m(eate)e(a)h(thr)m(ead)g
(that)g(sleeps)g(for)g(a)g(long)g(time,)78 b(which)69
b(pr)m(events)i(any)166 7586 y(deadlock)46 b(err)m(ors)f(\(including)f
(r)m(eal)h(ones\):)497 7991 y Fp(>)109 b(,open)g(threads)497
8223 y(>)g(\(spawn)h(\(lambda)f(\(\))1697 8455 y(;)g(Sleep)g(for)h(a)f
(year)1697 8687 y(\(sleep)g(\(*)h(1000)f(60)g(60)h(24)f(365\)\)\)\))202
9080 y Fl(\017)91 b Fp(\(add-signal-queue-signal!)i Fs(signal-queue)c
(signal)p Fp(\))202 9306 y Fl(\017)i Fp(\(remove-signal-queue-signal!)j
Fs(signal-queue)88 b(signal)p Fp(\))166 9672 y Ft(These)67
b(two)g(pr)m(ocedur)m(es)e(can)h(be)g(used)g(to)h(add)g(or)f(r)m(emove)
g(signals)g(fr)m(om)g(a)g(signal-queue's)166 9898 y(list)44
b(of)f(monitor)m(ed)g(signals.)56 b(When)43 b(a)g(signal)h(is)f(r)m
(emoved)g(fr)m(om)f(a)h(signal-queue's)f(list)i(of)f(mon-)166
10123 y(itor)m(ed)36 b(signals)f(any)g(occurances)f(of)h(the)h(signal)f
(ar)m(e)g(r)m(emoved)g(fr)m(om)f(that)i(signal-queue's)d(pend-)166
10349 y(ing)68 b(signals.)126 b(In)68 b(other)h(wor)m(ds,)74
b Fp(dequeue-signal!)127 b Ft(and)68 b Fp(maybe-dequeue-signal!)166
10575 y Ft(will)45 b(only)g(r)m(eturn)g(signals)g(that)h(ar)m(e)f(curr)
m(ently)f(on)i(the)g(signal-queue's)d(list)j(of)f(signals.)166
11209 y Fm(8.3)238 b(Process)60 b(environment)166 11643
y Ft(These)46 b(ar)m(e)f(in)g(str)o(uctur)m(es)f Fp(posix-process-data)
j Ft(and)f Fp(posix)p Ft(.)3495 12141 y(91)p eop end
%%Page: 92 100
TeXDict begin 92 99 bop 332 1146 a Fg(8.3.1)198 b(Process)50
b(identi\002cation)368 1499 y Fl(\017)91 b Fp(\(get-process-id\))i
Fl(!)181 b Fs(pr)m(ocess-id)368 1725 y Fl(\017)91 b Fp
(\(get-parent-process-id\))i Fl(!)182 b Fs(pr)m(ocess-id)332
2066 y Ft(These)46 b(r)m(eturn)f(the)g(pr)m(ocess)h(ids)f(of)h(the)f
(curr)m(ent)g(pr)m(ocess)g(and)g(its)h(par)m(ent.)57
b(See)46 b(section)f(8.1.1)h(for)332 2292 y(operations)g(on)g(pr)m
(ocess)f(ids.)368 2632 y Fl(\017)91 b Fp(\(get-user-id\))h
Fl(!)182 b Fs(user-id)368 2858 y Fl(\017)91 b Fp
(\(get-effective-user-id\))i Fl(!)182 b Fs(user-id)368
3084 y Fl(\017)91 b Fp(\(set-user-id!)h Fs(user-id)p
Fp(\))368 3424 y Fl(\017)f Fp(\(get-group-id\))h Fl(!)182
b Fs(gr)m(oup-id)368 3650 y Fl(\017)91 b Fp(\(get-effective-group-id\))
i Fl(!)182 b Fs(gr)m(oup-id)368 3876 y Fl(\017)91 b Fp(\(set-group-id!)
h Fs(gr)m(oup-id)p Fp(\))332 4216 y Ft(Every)53 b(pr)m(ocess)h(has)f
(both)g(the)g(original)g(and)g(ef)m(fective)f(user)h(id)g(and)g(gr)m
(oup)g(id.)81 b(The)53 b(ef)m(fective)332 4442 y(values)45
b(may)g(be)g(set,)h(but)f(not)h(the)g(original)f(ones.)368
4783 y Fl(\017)91 b Fp(\(get-groups\))h Fl(!)182 b Fs(gr)m(oup-ids)368
5008 y Fl(\017)91 b Fp(\(get-login-name\))i Fl(!)181
b Fs(string)332 5349 y Fp(Get-groups)92 b Ft(r)m(eturns)e(a)h(list)f
(of)h(the)g(supplementary)g(gr)m(oups)f(of)h(the)g(curr)m(ent)f(pr)m
(ocess.)332 5575 y Fp(Get-login-name)47 b Ft(r)m(eturns)e(a)g(user)g
(name)g(for)g(the)h(curr)m(ent)e(pr)m(ocess.)332 6084
y Fg(8.3.2)198 b(Environment)48 b(variables)368 6438
y Fl(\017)91 b Fp(\(lookup-environment-variable)j Fs(string)p
Fp(\))89 b Fl(!)i Fs(string)e(or)i Fp(#f)368 6664 y Fl(\017)g
Fp(\(environment-alist\))i Fl(!)e Fs(alist)332 7004 y
Fp(Lookup-environment-variable)76 b Ft(looks)e(up)f(its)g(ar)m(gument)f
(in)h(the)h(envir)m(onment)e(list)332 7230 y(and)64 b(r)m(eturns)f(the)
h(corr)m(esponding)f(value)g(or)h Fp(#f)g Ft(if)f(ther)m(e)h(is)g
(none.)112 b Fp(Environment-alist)332 7456 y Ft(r)m(eturns)45
b(the)g(entir)m(e)h(envir)m(onment)e(as)h(a)h(list)f(of)h
Fp(\()p Fs(name-string)107 b Fp(.)218 b Fs(value-string)p
Fp(\))43 b Ft(pairs.)332 8053 y Fm(8.4)238 b(Users)60
b(and)f(groups)332 8475 y Fs(User-id)p Ft(s)k(and)i Fs(gr)m(oup-id)p
Ft(s)e(ar)m(e)h(boxed)g(integers)h(r)m(epr)m(esenting)f(Unix)h(users)f
(and)h(gr)m(oups.)114 b(The)332 8700 y(pr)m(ocedur)m(es)45
b(in)g(this)h(section)f(ar)m(e)g(in)g(str)o(uctur)m(es)g
Fp(posix-users)h Ft(and)f Fp(posix)p Ft(.)368 9041 y
Fl(\017)91 b Fp(\(user-id?)103 b Fs(x)p Fp(\))91 b Fl(!)g
Fs(boolean)368 9267 y Fl(\017)g Fp(\(user-id=?)103 b
Fs(user-id0)89 b(user-id1)p Fp(\))g Fl(!)i Fs(boolean)368
9493 y Fl(\017)g Fp(\(user-id->integer)i Fs(user-id)p
Fp(\))c Fl(!)i Fs(integer)368 9718 y Fl(\017)g Fp(\(integer->user-id)i
Fs(integer)p Fp(\))c Fl(!)i Fs(user-id)368 10059 y Fl(\017)g
Fp(\(group-id?)103 b Fs(x)p Fp(\))91 b Fl(!)g Fs(boolean)368
10285 y Fl(\017)g Fp(\(group-id=?)103 b Fs(gr)m(oup-id0)89
b(gr)m(oup-id1)p Fp(\))g Fl(!)i Fs(boolean)368 10510
y Fl(\017)g Fp(\(group-id->integer)i Fs(gr)m(oup-id)p
Fp(\))c Fl(!)i Fs(integer)368 10736 y Fl(\017)g Fp(\(integer->group-id)
i Fs(integer)p Fp(\))c Fl(!)i Fs(gr)m(oup-id)332 11077
y Ft(User)m(-ids)50 b(and)h(gr)m(oup-ids)f(have)g(their)g(own)h(own)f
(pr)m(edicates)g(and)h(comparison,)h(boxing,)f(and)332
11303 y(unboxing)44 b(functions.)368 11643 y Fl(\017)91
b Fp(\(user-id->user-info)i Fs(user-id)p Fp(\))c Fl(!)i
Fs(user-info)3661 12141 y Ft(92)p eop end
%%Page: 93 101
TeXDict begin 93 100 bop 202 1146 a Fl(\017)91 b Fp(\(name->user-info)i
Fs(string)p Fp(\))c Fl(!)i Fs(user-info)166 1488 y Ft(These)46
b(r)m(eturn)f(the)g(user)g(info)g(for)g(a)h(user)f(identi\002ed)h(by)f
(user)m(-id)f(or)i(name.)202 1830 y Fl(\017)91 b Fp(\(user-info?)103
b Fs(x)p Fp(\))91 b Fl(!)182 b Fs(boolean)202 2056 y
Fl(\017)91 b Fp(\(user-info-name)h Fs(user-info)p Fp(\))d
Fl(!)182 b Fs(string)202 2282 y Fl(\017)91 b Fp(\(user-info-id)h
Fs(user-info)p Fp(\))d Fl(!)182 b Fs(user-id)202 2507
y Fl(\017)91 b Fp(\(user-info-group)i Fs(user-info)p
Fp(\))88 b Fl(!)182 b Fs(gr)m(oup-id)202 2733 y Fl(\017)91
b Fp(\(user-info-home-directory)i Fs(user-info)p Fp(\))c
Fl(!)182 b Fs(string)202 2959 y Fl(\017)91 b Fp(\(user-info-shell)i
Fs(user-info)p Fp(\))88 b Fl(!)182 b Fs(string)166 3301
y Ft(A)57 b Fp(user-info)h Ft(contains)e(information)g(about)h(a)f
(user)-13 b(.)90 b(A)-17 b(vailable)57 b(ar)m(e)f(the)h(user)13
b('s)56 b(name,)k(id,)166 3527 y(gr)m(oup,)46 b(home)f(dir)m(ectory)-20
b(,)45 b(and)h(shell.)202 3869 y Fl(\017)91 b Fp
(\(group-id->group-info)i Fs(gr)m(oup-id)p Fp(\))c Fl(!)i
Fs(gr)m(oup-info)202 4095 y Fl(\017)g Fp(\(name->group-info)i
Fs(string)p Fp(\))c Fl(!)i Fs(gr)m(oup-info)166 4437
y Ft(These)46 b(r)m(eturn)f(the)g(gr)m(oup)h(info)f(for)g(a)g(gr)m(oup)
g(identi\002ed)h(by)f(gr)m(oup-id)g(or)g(name.)202 4779
y Fl(\017)91 b Fp(\(group-info?)103 b Fs(x)p Fp(\))91
b Fl(!)182 b Fs(boolean)202 5005 y Fl(\017)91 b Fp(\(group-info-name)i
Fs(gr)m(oup-info)p Fp(\))88 b Fl(!)182 b Fs(string)202
5231 y Fl(\017)91 b Fp(\(group-info-id)h Fs(gr)m(oup-info)p
Fp(\))d Fl(!)182 b Fs(gr)m(oup-id)202 5456 y Fl(\017)91
b Fp(\(group-info-members)i Fs(gr)m(oup-info)p Fp(\))88
b Fl(!)182 b Fs(user-ids)166 5799 y Ft(A)48 b Fp(group-info)g
Ft(contains)f(information)f(about)h(a)g(gr)m(oup.)62
b(A)-17 b(vailable)47 b(ar)m(e)f(the)i(gr)m(oup's)e(name,)166
6024 y(id,)g(and)f(a)h(list)f(of)g(members.)166 6622
y Fm(8.5)238 b(OS)60 b(and)g(machine)e(identi\002cation)166
7044 y Ft(These)47 b(pr)m(ocedur)m(es)f(r)m(eturn)f(strings)h(that)h
(ar)m(e)f(supposed)h(to)g(identify)f(the)g(curr)m(ent)f(OS)i(and)f(ma-)
166 7270 y(chine.)54 b(The)39 b(POSIX)g(standar)m(d)g(does)g(not)g
(indicate)f(the)h(format)f(of)g(the)h(strings.)55 b(The)39
b(pr)m(ocedur)m(es)166 7495 y(ar)m(e)45 b(in)g(str)o(uctur)m(es)f
Fp(posix-platform-names)k Ft(and)d Fp(posix)p Ft(.)202
7837 y Fl(\017)91 b Fp(\(os-name\))h Fl(!)f Fs(string)202
8063 y Fl(\017)g Fp(\(os-node-name\))h Fl(!)f Fs(string)202
8289 y Fl(\017)g Fp(\(os-release-name\))i Fl(!)d Fs(string)202
8515 y Fl(\017)h Fp(\(os-version-name\))i Fl(!)d Fs(string)202
8741 y Fl(\017)h Fp(\(machine-name\))h Fl(!)f Fs(string)166
9338 y Fm(8.6)238 b(Files)59 b(and)g(directories)166
9760 y Ft(These)46 b(pr)m(ocedur)m(es)f(ar)m(e)g(in)g(str)o(uctur)m(es)
f Fp(posix-files)j Ft(and)e Fp(posix)p Ft(.)166 10270
y Fg(8.6.1)198 b(Directory)49 b(streams)166 10623 y Ft(Dir)m(ectory)65
b(str)m(eams)g(ar)m(e)g(like)g(input)h(ports,)72 b(with)65
b(each)g(r)m(ead)g(operation)h(r)m(eturning)e(the)i(next)166
10849 y(name)45 b(in)g(the)h(dir)m(ectory)-20 b(.)202
11191 y Fl(\017)91 b Fp(\(open-directory-stream)i Fs(name)p
Fp(\))e Fl(!)g Fs(dir)m(ectory)202 11417 y Fl(\017)g
Fp(\(directory-stream?)104 b Fs(x)p Fp(\))91 b Fl(!)f
Fs(boolean)202 11643 y Fl(\017)h Fp(\(read-directory-stream)i
Fs(dir)m(ectory)p Fp(\))c Fl(!)h Fs(name)h(or)g Fp(#f)3495
12141 y Ft(93)p eop end
%%Page: 94 102
TeXDict begin 94 101 bop 368 1146 a Fl(\017)91 b Fp
(\(close-directory-stream)i Fs(dir)m(ectory)p Fp(\))332
1474 y(Open-directory-stream)69 b Ft(opens)f(a)g(new)f(dir)m(ectory)g
(str)m(eam.)123 b Fp(Directory-stream?)332 1699 y Ft(is)f(a)g(pr)m
(edicate)g(that)g(r)m(ecognizes)g(dir)m(ectory)f(str)m(eams.)286
b Fp(Read-directory-stream)332 1925 y Ft(r)m(eturns)120
b(the)g(next)g(name)g(in)g(the)h(dir)m(ectory)f(or)g
Fp(#f)h Ft(if)e(all)i(names)e(have)h(been)g(r)m(ead.)332
2151 y Fp(Close-directory-stream)48 b Ft(closes)d(a)h(dir)m(ectory)f
(str)m(eam.)368 2479 y Fl(\017)91 b Fp(\(list-directory)i
Fs(name)p Fp(\))e Fl(!)f Fs(list)g(of)g(strings)332 2807
y Ft(This)46 b(is)f(the)h(obvious)f(utility;)h(it)f(r)m(eturns)g(a)g
(list)h(of)f(the)h(names)f(in)g(dir)m(ectory)g Fs(name)p
Ft(.)332 3313 y Fg(8.6.2)198 b(W)-15 b(orking)49 b(directory)368
3667 y Fl(\017)91 b Fp(\(working-directory\))i Fl(!)e
Fs(string)368 3893 y Fl(\017)g Fp(\(set-working-directory!)i
Fs(string)p Fp(\))332 4221 y Ft(These)46 b(r)m(eturn)f(and)g(set)h(the)
g(working)f(dir)m(ectory)-20 b(.)332 4727 y Fg(8.6.3)198
b(File)50 b(creation)f(and)g(removal)368 5081 y Fl(\017)91
b Fp(\(open-file)h Fs(path)e(\002le-options)p Fp(\))e
Fl(!)j Fs(port)368 5307 y Fl(\017)g Fp(\(open-file)h
Fs(path)e(\002le-options)e(\002le-mode)p Fp(\))i Fl(!)g
Fs(port)332 5635 y Fp(Open-file)59 b Ft(opens)g(a)f(port)h(to)g(the)f
(\002le)h(named)f(by)f(string)i Fs(path)p Ft(.)94 b(The)59
b Fs(\002le-options)c Ft(ar)m(gument)332 5861 y(determines)61
b(various)f(aspects)h(of)f(the)h(r)m(eturned)f(port.)103
b(The)61 b(optional)g Fs(\002le-mode)f Ft(ar)m(gument)f(is)332
6086 y(used)71 b(only)h(if)f(the)h(\002le)f(to)h(be)f(opened)h(does)g
(not)g(alr)m(eady)f(exist.)135 b(The)72 b(r)m(eturned)f(port)h(is)f(an)
332 6312 y(input)i(port)h(if)f Fs(\002le-options)e Ft(includes)h
Fp(read-only)p Ft(;)89 b(otherwise)73 b(it)h(r)m(eturns)e(an)h(output)h
(port.)332 6538 y Fp(Dup-switching-mode)60 b Ft(can)e(be)g(used)g(to)g
(open)h(an)f(input)g(port)h(for)f(output)h(ports)f(opened)332
6764 y(with)45 b(the)h Fp(read/write)g Ft(option.)368
7092 y Fl(\017)91 b Fp(\(file-options)h Fs(\002le-option-name)c
Fp(...\))46 b Fl(!)f Fs(\002le-options)1772 b Ft(syntax)368
7318 y Fl(\017)91 b Fp(\(file-options-on?)104 b Fs(\002le-options)88
b(\002le-options)p Fp(\))g Fl(!)i Fs(boolean)332 7645
y Ft(The)95 b(syntax)g Fp(file-options)h Ft(r)m(eturns)d(a)i
(\002le-option)g(with)f(the)h(indicated)g(options)g(set.)332
7871 y Fp(File-options-on?)55 b Ft(r)m(eturns)36 b(tr)o(ue)g(if)g(its)h
(\002rst)f(ar)m(gument)g(includes)g(all)g(of)g(the)h(options)h(listed)
332 8097 y(in)45 b(the)h(second)f(ar)m(gument.)56 b(The)46
b(following)f(\002le)g(options)i(may)e(be)g(used)g(with)g
Fp(open-file)p Ft(.)1090 8505 y Fp(create)1509 b Ft(cr)m(eate)39
b(\002le)g(if)f(it)h(does)g(not)h(alr)m(eady)e(exist;)k(a)d(\002le-)
3253 8731 y(mode)62 b(ar)m(gument)e(is)h(r)m(equir)m(ed)f(with)i(this)f
(op-)3253 8957 y(tion)1090 9183 y Fp(exclusive)1182 b
Ft(an)67 b(err)m(or)f(will)g(be)g(raised)h(if)f(this)h(option)g(and)
3253 9408 y Fp(create)f Ft(ar)m(e)f(both)g(set)h(and)g(the)f(\002le)h
(alr)m(eady)3253 9634 y(exists)1090 9860 y Fp(no-controlling-tty)201
b Ft(if)97 b Fs(path)f Ft(is)h(a)f(terminal)h(device)f(this)h(option)
3253 10086 y(causes)38 b(the)g(terminal)g(to)g(not)h(become)e(the)i
(con-)3253 10312 y(tr)m(olling)45 b(terminal)g(of)g(the)h(pr)m(ocess)
1090 10538 y Fp(truncate)1291 b Ft(\002le)46 b(is)f(tr)o(uncated)1090
10763 y Fp(append)1509 b Ft(writes)45 b(ar)m(e)g(appended)h(to)g
(existing)g(contents)1090 10989 y Fp(nonblocking)964
b Ft(r)m(ead)45 b(and)h(write)f(operations)h(do)g(not)f(block)1090
11215 y Fp(read-only)1182 b Ft(port)46 b(may)f(not)h(be)f(written)1090
11441 y Fp(read-write)1073 b Ft(\002le)46 b(descriptor)f(may)g(be)g(r)m
(ead)h(or)f(written)1090 11667 y Fp(write-only)1073 b
Ft(port)46 b(may)f(not)h(be)f(r)m(ead)3661 12141 y(94)p
eop end
%%Page: 95 103
TeXDict begin 95 102 bop 166 1146 a Ft(Only)45 b(one)h(of)f(the)h(last)
f(thr)m(ee)h(options)g(may)f(be)g(used.)448 1374 y(For)h(example)497
1761 y Fp(\(open-file)110 b("some-file.txt")1697 1990
y(\(file-options)g(create)g(write-only\))1697 2218 y(\(file-mode)g
(read)f(owner-write\)\))166 2603 y Ft(r)m(eturns)52 b(an)g(output)h
(port)h(that)f(writes)f(to)h(a)g(newly-cr)m(eated)e(\002le)i(that)g
(can)f(be)g(r)m(ead)h(by)f(anyone)166 2829 y(and)45 b(written)h(only)f
(by)g(the)h(owner)-13 b(.)56 b(Once)45 b(the)g(\002le)h(exists,)497
3216 y Fp(\(open-file)110 b("some-file.txt")1697 3444
y(\(file-options)g(append)g(write-only\)\))166 3830 y
Ft(will)45 b(open)h(an)f(output)h(port)g(that)g(appends)g(to)g(the)f
(\002le.)448 4058 y(The)c Fp(append)g Ft(and)g Fp(nonblocking)g
Ft(options)h(and)e(the)h(r)m(ead/write)f(natur)m(e)g(of)h(the)f(port)i
(can)166 4284 y(be)49 b(r)m(ead)h(using)f Fp(i/o-flags)p
Ft(.)71 b(The)50 b Fp(append)g Ft(and)f Fp(nonblocking)i
Ft(options)g(can)e(be)g(set)i(using)166 4509 y Fp(set-i/o-flags!)p
Ft(.)448 4738 y(T)-17 b(o)46 b(keep)e(port)h(operations)g(fr)m(om)e
(blocking)h(the)g(Scheme)g(48)g(pr)m(ocess,)h(output)g(ports)g(ar)m(e)f
(set)166 4963 y(to)i(be)f(nonblocking)f(at)i(the)f(time)g(of)g(cr)m
(eation)g(\(input)g(ports)h(ar)m(e)f(managed)f(using)h
Fp(select\(\))p Ft(\).)166 5189 y(Y)-17 b(ou)65 b(can)f(use)g
Fp(set-i/o-flags!)114 b Ft(to)65 b(make)f(an)g(output)h(port)g
(blocking,)k(for)64 b(example)g(just)166 5415 y(befor)m(e)j(a)h(fork,)
73 b(but)67 b(car)m(e)g(should)h(be)f(exer)m(cised.)124
b(The)68 b(Scheme)f(48)h(r)o(untime)e(code)i(may)g(get)166
5641 y(confused)45 b(if)g(an)g(I/O)h(operation)g(blocks.)202
5993 y Fl(\017)91 b Fp(\(set-file-creation-mask!)i Fs(\002le-mode)p
Fp(\))166 6345 y Ft(Sets)49 b(the)e(\002le)h(cr)m(eation)f(mask)g(to)h
(be)g Fs(\002le-mode)p Ft(.)61 b(Bits)48 b(set)g(in)g
Fs(\002le-mode)e Ft(ar)m(e)h(clear)m(ed)g(in)g(the)h(modes)166
6570 y(of)d(any)h(\002les)f(or)h(dir)m(ectories)f(cr)m(eated)g(by)g
(the)h(curr)m(ent)e(pr)m(ocess.)202 6922 y Fl(\017)91
b Fp(\(link)h Fs(existing)c(new)p Fp(\))166 7274 y(Link)59
b Ft(makes)f(path)g Fs(new)g Ft(be)g(a)g(new)g(link)g(to)h(the)f
(\002le)g(pointed)h(to)g(by)f(path)g Fs(existing)p Ft(.)93
b(The)59 b(two)166 7500 y(paths)46 b(must)f(be)g(in)g(the)h(same)f
(\002le)g(system.)202 7852 y Fl(\017)91 b Fp(\(make-directory)h
Fs(name)f(\002le-mode)p Fp(\))202 8077 y Fl(\017)g Fp(\(make-fifo)h
Fs(\002le-mode)p Fp(\))166 8429 y Ft(These)46 b(two)g(pr)m(ocedur)m(es)
e(make)i(new)f(dir)m(ectories)g(and)g(\002fo)g(\002les.)202
8781 y Fl(\017)91 b Fp(\(unlink)h Fs(path)p Fp(\))202
9007 y Fl(\017)f Fp(\(remove-directory)i Fs(path)p Fp(\))202
9233 y Fl(\017)e Fp(\(rename)h Fs(old-path)c(new-path)p
Fp(\))166 9585 y(Unlink)53 b Ft(r)m(emoves)f(the)h(link)g(indicated)f
(by)h Fs(path)p Ft(.)78 b Fp(Remove-directory)54 b Ft(r)m(emoves)e(the)
h(indi-)166 9810 y(cated)e(\(empty\))g(dir)m(ectory)-20
b(.)74 b Fp(Rename)52 b Ft(moves)f(the)g(\002le)h(pointed)g(to)g(by)f
Fs(old-path)e Ft(to)i(the)h(location)166 10036 y(pointed)64
b(to)f(by)g Fs(new-path)f Ft(\(the)h(two)g(paths)h(must)e(be)h(in)g
(the)g(same)g(\002le)g(system\).)109 b(Any)64 b(other)166
10262 y(links)45 b(to)h(the)g(\002le)f(r)m(emain)g(unchanged.)202
10614 y Fl(\017)91 b Fp(\(accessible?)103 b Fs(path)90
b(access-mode)f(.)103 b(mor)m(e-modes)p Fp(\))89 b Fl(!)i
Fs(boolean)202 10840 y Fl(\017)g Fp(\(access-mode)h Fs(mode-name)p
Fp(\))45 b Fl(!)g Fs(access-mode)2587 b Ft(syntax)166
11191 y Fp(Accessible?)112 b Ft(r)m(eturns)62 b(tr)o(ue)h(if)g
Fs(path)g Ft(is)g(a)h(\002le)f(that)h(can)f(be)g(accessed)h(in)f(the)h
(listed)g(mode.)166 11417 y(If)55 b(mor)m(e)g(than)g(one)g(mode)g(is)g
(speci\002ed)h Fp(accessible?)86 b Ft(r)m(eturns)54 b(tr)o(ue)h(if)g
(all)f(of)h(the)h(speci\002ed)166 11643 y(modes)46 b(ar)m(e)f
(permitted.)57 b(The)46 b Fs(mode-name)p Ft(s)e(ar)m(e:)57
b Fp(read)p Ft(,)46 b Fp(write)p Ft(,)g Fp(execute)p
Ft(,)h Fp(exists)p Ft(.)3495 12141 y(95)p eop end
%%Page: 96 104
TeXDict begin 96 103 bop 332 1146 a Fg(8.6.4)198 b(File)50
b(information)368 1499 y Fl(\017)91 b Fp(\(get-file-info)h
Fs(name)p Fp(\))f Fl(!)g Fs(\002le-info)368 1725 y Fl(\017)g
Fp(\(get-file/link-info)i Fs(name)p Fp(\))e Fl(!)g Fs(\002le-info)368
1951 y Fl(\017)g Fp(\(get-port-info)h Fs(fd-port)p Fp(\))d
Fl(!)i Fs(\002le-info)332 2227 y Fp(Get-file-info)64
b Ft(and)e Fp(get-file/link-info)i Ft(both)f(r)m(eturn)e(a)i(\002le)f
(info)g(r)m(ecor)m(d)g(for)g(the)332 2453 y(named)c(\002le.)97
b Fp(Get-file-info)60 b Ft(follows)e(symbolic)g(links)g(while)g
Fp(get-file/link-info)332 2679 y Ft(does)45 b(not.)56
b Fp(Get-port-info)45 b Ft(r)m(eturns)e(a)h(\002le)g(info)f(r)m(ecor)m
(d)h(for)f(the)h(\002le)g(which)f Fs(port)g Ft(r)m(eads)g(fr)m(om)332
2905 y(or)e(writes)g(to.)55 b(An)42 b(err)m(or)e(is)h(raised)g(if)f
Fs(fd-port)f Ft(does)i(not)g(r)m(ead)g(fr)m(om)e(or)i(write)g(to)g(a)g
(\002le)g(descriptor)-13 b(.)368 3181 y Fl(\017)91 b
Fp(\(file-info?)103 b Fs(x)p Fp(\))91 b Fl(!)g Fs(boolean)368
3407 y Fl(\017)g Fp(\(file-info-name)i Fs(\002le-info)p
Fp(\))88 b Fl(!)j Fs(string)332 3683 y Fp(File-info?)154
b Ft(is)78 b(a)g(pr)m(edicate)f(for)h(\002le-info)f(r)m(ecor)m(ds.)153
b Fp(File-info-name)79 b Ft(is)f(the)g(name)332 3908
y(which)113 b(was)h(used)g(to)h(get)f Fp(file-info)p
Ft(,)133 b(either)114 b(as)g(passed)h(to)g Fp(get-file-info)g
Ft(or)332 4134 y Fp(get-file/link-info)p Ft(,)48 b(or)d(used)h(to)g
(open)f(the)h(port)g(passed)g(to)g Fp(get-port-info)p
Ft(.)368 4410 y Fl(\017)91 b Fp(\(file-info-type)i Fs(\002le-info)p
Fp(\))88 b Fl(!)j Fs(\002le-type)368 4636 y Fl(\017)g
Fp(\(file-type?)103 b Fs(x)p Fp(\))91 b Fl(!)g Fs(boolean)368
4862 y Fl(\017)g Fp(\(file-type-name)i Fs(\002le-type)p
Fp(\))88 b Fl(!)j Fs(symbol)368 5088 y Fl(\017)g Fp(\(file-type)h
Fs(type)p Fp(\))45 b Fl(!)g Fs(\002le-type)3624 b Ft(syntax)332
5364 y Fp(File-info-type)55 b Ft(r)m(eturns)e(the)h(type)g(of)g(the)g
(\002le,)i(as)d(a)h(\002le-type)g(object)f(File)h(types)g(may)f(be)332
5590 y(compar)m(ed)45 b(using)g Fp(eq?)p Ft(.)57 b(The)46
b(valid)f(\002le)g(types)i(ar)m(e:)2879 5936 y Fp(regular)2879
6162 y(directory)2879 6387 y(character-device)2879 6613
y(block-device)2879 6839 y(fifo)2879 7065 y(symbolic-link)2879
7291 y(socket)2879 7517 y(other)332 7853 y(Symbolic-link)g
Ft(and)e Fp(socket)h Ft(ar)m(e)f(not)h(r)m(equir)m(ed)e(by)h(POSIX.)368
8130 y Fl(\017)91 b Fp(\(file-info-device)i Fs(\002le-info)p
Fp(\))88 b Fl(!)j Fs(integer)368 8355 y Fl(\017)g Fp(\(file-info-inode)
i Fs(\002le-info)p Fp(\))88 b Fl(!)j Fs(integer)332 8632
y Ft(The)46 b(device)f(and)g(inode)h(numbers)e(uniquely)g(determine)h
(a)h(\002le.)368 8908 y Fl(\017)91 b Fp(\(file-info-link-count)i
Fs(\002le-info)p Fp(\))c Fl(!)i Fs(integer)368 9133 y
Fl(\017)g Fp(\(file-info-size)i Fs(\002le-info)p Fp(\))88
b Fl(!)j Fs(integer)332 9410 y Ft(These)59 b(r)m(eturn)e(the)i(number)d
(of)i(links)g(to)h(a)f(\002le)g(and)g(the)h(\002le)f(size)g(in)g
(bytes.)95 b(The)59 b(size)f(is)g(only)332 9635 y(meaningful)44
b(for)h(r)m(egular)f(\002les.)368 9911 y Fl(\017)91 b
Fp(\(file-info-owner)i Fs(\002le-info)p Fp(\))88 b Fl(!)j
Fs(user-id)368 10137 y Fl(\017)g Fp(\(file-info-group)i
Fs(\002le-info)p Fp(\))88 b Fl(!)j Fs(gr)m(oup-id)368
10363 y Fl(\017)g Fp(\(file-info-mode)i Fs(\002le-info)p
Fp(\))88 b Fl(!)j Fs(\002le-mode)332 10639 y Ft(These)46
b(r)m(eturn)f(the)g(owner)-13 b(,)45 b(gr)m(oup,)h(and)f(access)h(mode)
f(of)g(a)h(\002le.)368 10915 y Fl(\017)91 b Fp(\(file-info-last-access)
i Fs(\002le-info)p Fp(\))c Fl(!)i Fs(time)368 11141 y
Fl(\017)g Fp(\(file-info-last-modification)j Fs(\002le-info)p
Fp(\))88 b Fl(!)j Fs(time)368 11367 y Fl(\017)g Fp
(\(file-info-last-info-change)j Fs(\002le-info)p Fp(\))88
b Fl(!)j Fs(time)332 11643 y Ft(These)46 b(r)m(eturn)f(the)g(time)h
(the)f(\002le)h(was)f(last)g(r)m(ead,)h(modi\002ed,)g(or)f(had)h(its)f
(status)h(modi\002ed)3661 12141 y(96)p eop end
%%Page: 97 105
TeXDict begin 97 104 bop 166 1146 a Fg(8.6.5)198 b(File)50
b(modes)166 1508 y Ft(A)c(\002le)f(mode)h(is)f(a)h(boxed)f(integer)g(r)
m(epr)m(esenting)h(a)f(\002le)g(pr)m(otection)h(mask.)202
1867 y Fl(\017)91 b Fp(\(file-mode)h(permission-name)g(...\))46
b Fl(!)f Fs(\002le-mode)1813 b Ft(syntax)202 2093 y Fl(\017)91
b Fp(\(file-mode?)103 b Fs(x)p Fp(\))91 b Fl(!)g Fs(boolean)202
2319 y Fl(\017)g Fp(\(file-mode+)h Fs(\002le-mode)e(.)27
b(.)g(.)g Fp(\))104 b Fl(!)90 b Fs(\002le-mode)202 2544
y Fl(\017)h Fp(\(file-mode-)h Fs(\002le-mode0)e(\002le-mode1)p
Fp(\))f Fl(!)i Fs(\002le-mode)166 2903 y Fp(File-mode)79
b Ft(is)g(syntax)f(for)g(cr)m(eating)g(\002le)h(modes.)156
b(The)79 b(mode-names)e(ar)m(e)h(listed)h(below)-17 b(.)166
3129 y Fp(File-mode?)108 b Ft(is)63 b(a)f(pr)m(edicate)g(for)g(\002le)h
(modes.)107 b Fp(File-mode+)64 b Ft(r)m(eturns)d(a)i(mode)f(that)h
(con-)166 3355 y(tains)49 b(all)g(of)g(permissions)g(of)g(its)h(ar)m
(guments.)67 b Fp(File-mode-)50 b Ft(r)m(eturns)e(a)i(mode)f(that)g
(has)g(all)g(of)166 3581 y(the)d(permissions)f(of)g Fs(\002le-mode0)f
Ft(that)i(ar)m(e)f(not)h(in)f Fs(\002le-mode1)p Ft(.)202
3940 y Fl(\017)91 b Fp(\(file-mode=?)103 b Fs(\002le-mode0)90
b(\002le-mode1)p Fp(\))f Fl(!)i Fs(boolean)202 4166 y
Fl(\017)g Fp(\(file-mode<=?)103 b Fs(\002le-mode0)90
b(\002le-mode1)p Fp(\))f Fl(!)i Fs(boolean)202 4391 y
Fl(\017)g Fp(\(file-mode>=?)103 b Fs(\002le-mode0)90
b(\002le-mode1)p Fp(\))f Fl(!)i Fs(boolean)166 4750 y
Fp(File-mode=?)g Ft(r)m(eturns)56 b(tr)o(ue)g(if)g(the)g(two)h(modes)g
(ar)m(e)f(exactly)g(the)h(same.)90 b Fp(File-mode<=?)166
4976 y Ft(r)m(eturns)44 b(tr)o(ue)f(if)h Fs(\002le-mode0)f
Ft(has)h(a)g(subset)g(of)g(the)h(permissions)f(of)g Fs(\002le-mode1)p
Ft(.)55 b Fp(File-mode>=?)166 5202 y Ft(is)45 b Fp(file-mode<=?)58
b Ft(with)45 b(the)h(ar)m(guments)e(r)m(eversed.)202
5561 y Fl(\017)91 b Fp(\(file-mode->integer)i Fs(\002le-mode)p
Fp(\))c Fl(!)i Fs(integer)202 5787 y Fl(\017)g Fp(\(integer->file-mode)
i Fs(integer)p Fp(\))c Fl(!)i Fs(\002le-mode)166 6146
y Fp(Integer->file-mode)96 b Ft(and)e Fp(file-mode->integer)h
Ft(translate)f(\002le)g(modes)h(to)f(and)166 6371 y(fr)m(om)53
b(the)g(classic)g(Unix)h(\002le)g(mode)f(masks.)82 b(These)54
b(may)f(not)h(be)f(the)h(masks)f(used)h(by)f(the)h(un-)166
6597 y(derlying)45 b(OS.)1192 7048 y(Permission)g(name)199
b(Bit)46 b(mask)1192 7274 y Fp(set-uid)821 b(#o4000)243
b Ft(set)46 b(user)f(id)h(when)f(executing)1192 7499
y Fp(set-gid)821 b(#o2000)243 b Ft(set)46 b(gr)m(oup)g(id)f(when)g
(executing)1192 7725 y Fp(owner-read)494 b(#o0400)243
b Ft(r)m(ead)46 b(by)f(owner)1192 7951 y Fp(owner-write)385
b(#o0200)243 b Ft(write)46 b(by)f(owner)1192 8177 y Fp(owner-exec)494
b(#o0100)243 b Ft(execute)46 b(\(or)f(sear)m(ch\))f(by)h(owner)1192
8403 y Fp(group-read)494 b(#o0040)243 b Ft(r)m(ead)46
b(by)f(gr)m(oup)1192 8629 y Fp(group-write)385 b(#o0020)243
b Ft(write)46 b(by)f(gr)m(oup)1192 8854 y Fp(group-exec)494
b(#o0010)243 b Ft(execute)46 b(\(or)f(sear)m(ch\))f(by)h(gr)m(oup)1192
9080 y Fp(other-read)494 b(#o0004)243 b Ft(r)m(ead)46
b(by)f(others)1192 9306 y Fp(other-write)385 b(#o0002)243
b Ft(write)46 b(by)f(others)1192 9532 y Fp(other-exec)494
b(#o0001)243 b Ft(execute)46 b(\(or)f(sear)m(ch\))f(by)h(others)1423
9995 y(Names)g(for)g(sets)h(of)f(permissions)1423 10220
y Fp(owner)199 b(#o0700)h Ft(r)m(ead,)46 b(write,)f(and)h(execute)f(by)
g(owner)1423 10446 y Fp(group)199 b(#o0070)h Ft(r)m(ead,)46
b(write,)f(and)h(execute)f(by)g(gr)m(oup)1423 10672 y
Fp(other)199 b(#o0007)h Ft(r)m(ead,)46 b(write,)f(and)h(execute)f(by)g
(others)1423 10898 y Fp(read)308 b(#o0444)200 b Ft(r)m(ead)45
b(by)g(anyone)1423 11124 y Fp(write)199 b(#o0222)h Ft(write)45
b(by)g(anyone)1423 11349 y Fp(exec)308 b(#o0111)200 b
Ft(execute)45 b(by)g(anyone)1423 11575 y Fp(all)417 b(#o0777)200
b Ft(anything)45 b(by)g(anyone)3495 12141 y(97)p eop
end
%%Page: 98 106
TeXDict begin 98 105 bop 332 1146 a Fm(8.7)238 b(T)-13
b(ime)332 1568 y Ft(These)46 b(pr)m(ocedur)m(es)f(ar)m(e)g(in)g(str)o
(uctur)m(es)f Fp(posix-time)j Ft(and)e Fp(posix)p Ft(.)368
1846 y Fl(\017)91 b Fp(\(make-time)h Fs(integer)p Fp(\))d
Fl(!)i Fs(time)368 2072 y Fl(\017)g Fp(\(current-time\))h
Fl(!)f Fs(time)368 2297 y Fl(\017)g Fp(\(time?)103 b
Fs(x)p Fp(\))91 b Fl(!)f Fs(boolean)368 2523 y Fl(\017)h
Fp(\(time-seconds)h Fs(time)p Fp(\))f Fl(!)f Fs(integer)332
2801 y Ft(A)46 b Fp(time)f Ft(r)m(ecor)m(d)f(contains)h(an)g(integer)g
(that)h(r)m(epr)m(esents)f(time)g(as)g(the)g(number)e(of)i(second)g
(since)332 3027 y(the)67 b(Unix)g(epoch)f(\(00:00:00)h(GMT)-13
b(,)67 b(January)e(1,)72 b(1970\).)120 b Fp(Make-time)68
b Ft(and)e Fp(current-time)332 3253 y Ft(r)m(eturn)46
b Fp(time)p Ft(s,)i(with)e Fp(make-time)p Ft('s)i(using)e(its)h(ar)m
(gument)f(while)g Fp(current-time)p Ft('s)h(has)g(the)332
3479 y(curr)m(ent)38 b(time.)55 b Fp(Time?)g Ft(is)39
b(a)g(pr)m(edicate)h(that)f(r)m(ecognizes)g Fp(time)p
Ft(s)h(and)f Fp(time-seconds)i Ft(r)m(eturns)332 3705
y(the)46 b(number)e(of)h(seconds)h Fs(time)e Ft(r)m(epr)m(esents.)368
3983 y Fl(\017)91 b Fp(\(time=?)103 b Fs(time)90 b(time)p
Fp(\))g Fl(!)h Fs(boolean)368 4209 y Fl(\017)g Fp(\(time<?)103
b Fs(time)90 b(time)p Fp(\))g Fl(!)h Fs(boolean)368 4435
y Fl(\017)g Fp(\(time<=?)103 b Fs(time)90 b(time)p Fp(\))g
Fl(!)h Fs(boolean)368 4660 y Fl(\017)g Fp(\(time>?)103
b Fs(time)90 b(time)p Fp(\))g Fl(!)h Fs(boolean)368 4886
y Fl(\017)g Fp(\(time>=?)103 b Fs(time)90 b(time)p Fp(\))g
Fl(!)h Fs(boolean)332 5164 y Ft(These)46 b(perform)f(various)g
(comparison)g(operations)h(on)f(the)h Fp(time)p Ft(s.)368
5443 y Fl(\017)91 b Fp(\(time->string)h Fs(time)p Fp(\))f
Fl(!)f Fs(string)332 5721 y Fp(Time->string)47 b Ft(r)m(eturns)d(a)i
(string)f(r)m(epr)m(esentation)h(of)f Fs(time)g Ft(in)g(the)g
(following)g(form.)663 6032 y Fp("Wed)109 b(Jun)h(30)f(21:49:08)h(1993)
663 6258 y(")332 6842 y Fm(8.8)238 b(I/O)332 7264 y Ft(These)46
b(pr)m(ocedur)m(es)f(ar)m(e)g(in)g(str)o(uctur)m(es)f
Fp(posix-i/o)j Ft(and)e Fp(posix)p Ft(.)368 7542 y Fl(\017)91
b Fp(\(open-pipe\))h Fl(!)f Fs(input-port)d(+)k(output-port)332
7820 y Fp(Open-pipe)70 b Ft(cr)m(eates)f(a)g(new)g(pipe)g(and)g(r)m
(eturns)g(the)g(two)g(ends)h(as)f(an)g(input)g(port)g(and)g(an)332
8046 y(output)46 b(port.)614 8272 y(A)86 b Fs(\002le)f(descriptor)e
Ft(port)j(\(or)f Fs(fd-port)p Ft(\))e(is)j(a)f(port)h(that)g(r)m(eads)f
(to)h(or)g(writes)f(fr)m(om)g(an)g(OS)332 8498 y(\002le)56
b(descriptor)-13 b(.)89 b(Fd-ports)56 b(ar)m(e)g(r)m(eturned)f(by)h
Fp(open-input-file)p Ft(,)k Fp(open-output-file)p Ft(,)332
8724 y Fp(open-file)p Ft(,)47 b Fp(open-pipe)p Ft(,)g(and)e(other)h(pr)
m(ocedur)m(es.)368 9002 y Fl(\017)91 b Fp(\(fd-port?)103
b Fs(port)p Fp(\))90 b Fl(!)h Fs(boolean)368 9228 y Fl(\017)g
Fp(\(port->fd)h Fs(port)p Fp(\))e Fl(!)h Fs(integer)e(or)h
Fp(#f)332 9506 y(Fd-port?)k Ft(r)m(eturns)56 b(tr)o(ue)h(if)g(its)h(ar)
m(gument)f(is)g(an)h(fd-port.)93 b Fp(Port->fd)58 b Ft(r)m(eturns)f
(the)h(\002le)f(de-)332 9732 y(scriptor)46 b(associated)g(with)f(or)g
Fp(#f)h Ft(if)f Fs(port)f Ft(is)i(not)f(an)g(fd-port.)368
10010 y Fl(\017)91 b Fp(\(remap-file-descriptors)i Fs(fd-spec)d(.)27
b(.)g(.)g Fp(\))332 10288 y(Remap-file-descriptors)51
b Ft(r)m(eassigns)e(\002le)g(descriptors)g(to)h(ports.)68
b(The)49 b Fs(fd-specs)e Ft(indicate)332 10514 y(which)k(port)h(is)g
(to)h(be)e(mapped)h(to)g(each)g(\002le)g(descriptor:)70
b(the)52 b(\002rst)g(gets)g(\002le)g(descriptor)g Fp(0)p
Ft(,)i(the)332 10740 y(second)46 b(gets)h Fp(1)p Ft(,)g(and)f(so)h
(forth.)58 b(A)47 b Fs(fd-spec)d Ft(is)j(either)f(a)g(port)h(that)f(r)m
(eads)g(fr)m(om)f(or)h(writes)g(to)h(a)f(\002le)332 10966
y(descriptor)-13 b(,)41 b(or)f Fp(#f)p Ft(,)i(with)d
Fp(#f)h Ft(indicating)f(that)h(the)g(corr)m(esponding)g(\002le)g
(descriptor)g(is)g(not)g(used.)332 11191 y(Any)54 b(open)g(ports)g(not)
f(listed)h(ar)m(e)f(marked)g(`close-on-exec'.)79 b(The)53
b(same)g(port)h(may)f(be)g(moved)332 11417 y(to)46 b(multiple)f(new)g
(\002le)h(descriptors.)614 11643 y(For)g(example,)3661
12141 y(98)p eop end
%%Page: 99 107
TeXDict begin 99 106 bop 497 1146 a Fp(\(remap-file-descriptors)111
b(\(current-output-port\))3115 1372 y(#f)3115 1597 y
(\(current-input-port\)\))166 1966 y Ft(moves)62 b(the)f(curr)m(ent)g
(output)h(port)h(to)f(\002le)g(descriptor)g Fp(0)g Ft(and)f(the)h(curr)
m(ent)f(input)g(port)i(to)f(\002le)166 2192 y(descriptor)46
b Fp(2)p Ft(.)202 2527 y Fl(\017)91 b Fp(\(dup)g Fs(fd-port)p
Fp(\))e Fl(!)i Fs(fd-port)202 2753 y Fl(\017)g Fp(\(dup-switching-mode)
i Fs(fd-port)p Fp(\))c Fl(!)h Fs(fd-port)202 2979 y Fl(\017)h
Fp(\(dup2)h Fs(fd-port)c(\002le-descriptor)p Fp(\))g
Fl(!)i Fs(fd-port)166 3315 y Ft(These)39 b(change)e Fs(fd-port)p
Ft('s)f(\002le)i(descriptor)h(and)f(r)m(eturn)f(a)h(new)g(port)h(that)f
(uses)g Fs(ports)p Ft('s)f(old)h(\002le)g(de-)166 3540
y(scriptor)-13 b(.)62 b Fp(Dup)48 b Ft(uses)f(the)h(lowest)f(unused)g
(\002le)h(descriptor)f(and)g Fp(dup2)h Ft(uses)f(the)h(one)g(pr)m
(ovided.)166 3766 y Fp(Dup-switching-mode)55 b Ft(is)f(the)f(same)g(as)
h Fp(dup)g Ft(except)f(that)h(the)g(r)m(eturned)e(port)i(is)g(an)f
(input)166 3992 y(port)f(if)g(the)f(ar)m(gument)g(was)g(an)h(output)g
(port)g(and)g(vice)f(versa.)75 b(If)52 b(any)f(existing)h(port)g(uses)g
(the)166 4218 y(\002le)45 b(descriptor)h(passed)g(to)g
Fp(dup2)p Ft(,)h(that)e(port)h(is)g(closed.)202 4553
y Fl(\017)91 b Fp(\(close-all-but)h Fs(port)e(.)27 b(.)g(.)g
Fp(\))166 4889 y(Close-all-but)43 b Ft(closes)g(all)e(\002le)i
(descriptors)f(whose)g(associated)h(ports)f(ar)m(e)g(not)h(passed)f(to)
h(it)166 5115 y(as)i(ar)m(guments.)202 5450 y Fl(\017)91
b Fp(\(close-on-exec?)103 b Fs(port)p Fp(\))90 b Fl(!)h
Fs(boolean)202 5676 y Fl(\017)g Fp(\(set-close-on-exec?!)i
Fs(port)d(boolean)p Fp(\))166 6012 y(Close-on-exec?)55
b Ft(r)m(eturns)35 b(tr)o(ue)h(if)g Fp(port)h Ft(will)f(be)g(closed)h
(when)e(a)i(new)f(pr)m(ogram)g(is)g(exec'ed.)166 6238
y Fp(Set-close-on-exec?!)58 b Ft(sets)46 b Fp(port)p
Ft('s)g(close-on-exec)e(\003ag.)202 6573 y Fl(\017)91
b Fp(\(i/o-flags)h Fs(port)p Fp(\))e Fl(!)h Fs(\002le-options)202
6799 y Fl(\017)g Fp(\(set-i/o-flags!)h Fs(port)e(\002le-options)p
Fp(\))166 7134 y Ft(These)50 b(two)f(pr)m(ocedur)m(es)f(r)m(ead)h(and)f
(write)h(various)f(options)i(for)f Fp(port)p Ft(.)67
b(The)50 b(options)f(that)h(can)166 7360 y(be)60 b(r)m(ead)f(ar)m(e)h
Fp(append)p Ft(,)65 b Fp(nonblocking)p Ft(,)g Fp(read-only)p
Ft(,)g Fp(write-only)p Ft(,)g(and)60 b Fp(read/write)p
Ft(.)166 7586 y(Only)45 b(the)h Fp(append)g Ft(and)f
Fp(nonblocking)i Ft(can)d(be)i(written.)202 7922 y Fl(\017)91
b Fp(\(port-is-a-terminal?)104 b Fs(port)p Fp(\))90 b
Fl(!)g Fs(boolean)202 8147 y Fl(\017)h Fp(\(port-terminal-name)i
Fs(port)p Fp(\))d Fl(!)g Fs(string)166 8483 y Fp(Port-is-a-terminal?)69
b Ft(r)m(eturns)49 b(tr)o(ue)f(if)h Fs(port)f Ft(has)h(an)g(underlying)
g(\002le)g(descriptor)h(that)f(is)166 8709 y(associated)i(with)f(a)g
(terminal.)71 b(For)51 b(such)e(ports)i Fp(port-terminal-name)h
Ft(r)m(eturns)e(the)h(name)166 8935 y(of)45 b(the)h(terminal,)f(for)g
(all)g(others)h(it)g(r)m(eturns)f Fp(#f)p Ft(.)166 9531
y Fm(8.9)238 b(Regular)58 b(expressions)166 9953 y Ft(The)52
b(pr)m(ocedur)m(es)e(in)i(this)f(section)h(pr)m(ovide)f(access)g(to)h
(POSIX)g(r)m(egular)e(expr)m(ession)i(matching.)166 10178
y(The)42 b(r)m(egular)e(expr)m(ession)h(syntax)h(and)f(semantics)g(ar)m
(e)g(far)f(too)i(complex)f(to)h(be)f(described)g(her)m(e.)166
10404 y(Because)52 b(the)g(C)g(interface)f(uses)h(zer)m(o)g(bytes)g
(for)f(marking)g(the)i(ends)f(of)g(strings,)i(patterns)e(and)166
10630 y(strings)46 b(that)f(contain)g(zer)m(o)h(bytes)f(will)g(not)h
(work)f(corr)m(ectly)-20 b(.)448 10856 y(These)46 b(pr)m(ocedur)m(es)f
(ar)m(e)g(in)g(str)o(uctur)m(es)f Fp(posix-regexps)j
Ft(and)e Fp(posix)p Ft(.)448 11082 y(An)57 b(abstract)e(data)h(type)h
(for)f(cr)m(eating)f(POSIX)i(r)m(egular)d(expr)m(essions)j(is)e
(described)h(in)g(sec-)166 11308 y(tion)46 b(5.20.)202
11643 y Fl(\017)91 b Fp(\(make-regexp)h Fs(string)e(.)102
b(r)m(egexp-options)p Fp(\))87 b Fl(!)k Fs(r)m(egexp)3495
12141 y Ft(99)p eop end
%%Page: 100 108
TeXDict begin 100 107 bop 368 1146 a Fl(\017)91 b Fp(\(regexp-option)h
Fs(option-name)p Fp(\))44 b Fl(!)h Fs(r)m(egexp-option)2165
b Ft(syntax)332 1488 y Fp(Make-regexp)50 b Ft(makes)f(a)h(new)f(r)m
(egular)f(expr)m(ession,)j(using)e Fs(string)e Ft(as)j(the)f(pattern.)
69 b(The)50 b(pos-)332 1714 y(sible)45 b(option)h(names)f(ar)m(e:)1955
2139 y Fp(extended)528 b Ft(use)45 b(the)g(extended)h(patterns)1955
2365 y Fp(ignore-case)201 b Ft(ignor)m(e)45 b(case)g(when)g(matching)
1955 2590 y Fp(submatches)310 b Ft(r)m(eport)45 b(submatches)1955
2816 y Fp(newline)637 b Ft(tr)m(eat)45 b(newlines)g(specially)614
3232 y(The)64 b(r)m(egular)d(expr)m(ession)i(is)g(not)g(compiled)g
(until)f(it)h(matched)f(against)h(a)g(string,)k(so)c(any)332
3458 y(err)m(ors)45 b(in)g(the)h(pattern)g(string)f(will)g(not)h(be)f
(r)m(eported)h(until)f(that)h(point.)368 3800 y Fl(\017)91
b Fp(\(regexp?)103 b Fs(x)p Fp(\))91 b Fl(!)f Fs(boolean)332
4142 y Ft(This)46 b(is)f(a)h(pr)m(edicate)f(for)g(r)m(egular)g(expr)m
(essions.)368 4484 y Fl(\017)91 b Fp(\(regexp-match)h
Fs(r)m(egexp)e(string)f(start)h(submatches?)100 b(starts-line?)e
(ends-line?)p Fp(\))914 4710 y Fl(!)109 b Fs(boolean)44
b(or)h(list)f(of)g(matches)368 4936 y Fl(\017)91 b Fp(\(match?)103
b Fs(x)p Fp(\))91 b Fl(!)f Fs(boolean)368 5162 y Fl(\017)h
Fp(\(match-start)h Fs(match)p Fp(\))f Fl(!)g Fs(integer)368
5388 y Fl(\017)g Fp(\(match-end)h Fs(match)p Fp(\))f
Fl(!)f Fs(integer)332 5730 y Fp(Regexp-match)99 b Ft(matches)f(the)g(r)
m(egular)f(expr)m(ession)h(against)g(the)g(characters)f(in)h
Fs(string)p Ft(,)332 5955 y(starting)i(at)f(position)h
Fs(start)p Ft(.)217 b(If)99 b(the)h(string)f(does)h(not)g(match)f(the)g
(r)m(egular)g(expr)m(ession,)332 6181 y Fp(regexp-match)72
b Ft(r)m(eturns)e Fp(#f)p Ft(.)133 b(If)71 b(the)g(string)f(does)i
(match,)77 b(then)70 b(a)h(list)g(of)g(match)f(r)m(ecor)m(ds)332
6407 y(is)c(r)m(eturned)g(if)g Fs(submatches?)118 b Ft(is)66
b(tr)o(ue,)72 b(or)66 b Fp(#t)h Ft(is)f(r)m(eturned)g(if)g(it)g(is)g
(not.)120 b(Each)66 b(match)g(r)m(ecor)m(d)332 6633 y(contains)54
b(the)g(index)g(of)g(the)h(character)e(at)h(the)g(beginning)g(of)g(the)
g(match)f(and)h(one)h(mor)m(e)e(than)332 6859 y(the)g(index)g(of)g(the)
g(character)f(at)h(the)g(end.)79 b(The)54 b(\002rst)f(match)f(r)m(ecor)
m(d)g(gives)h(the)g(location)g(of)g(the)332 7085 y(substring)44
b(that)i(matched)e Fs(r)m(egexp)p Ft(.)56 b(If)44 b(the)i(pattern)f(in)
g Fs(r)m(egexp)f Ft(contained)h(submatches,)f(then)h(the)332
7310 y(r)m(esults)g(of)g(these)g(ar)m(e)g(r)m(eturned)g(in)g(or)m(der)
-13 b(,)45 b(with)g(a)g(match)f(r)m(ecor)m(ds)h(r)m(eporting)g
(submatches)f(that)332 7536 y(succeeded)h(and)g Fp(#f)h
Ft(in)f(place)h(of)f(those)h(that)g(did)f(not.)614 7762
y Fs(Starts-line?)81 b Ft(should)55 b(be)f(tr)o(ue)g(if)g
Fs(string)g Ft(starts)h(at)g(the)f(beginning)g(of)h(a)f(line)h(and)f
Fs(ends-line?)332 7988 y Ft(should)45 b(be)g(tr)o(ue)g(if)g(it)h(ends)f
(one.)332 8585 y Fm(8.10)238 b(C)59 b(to)g(Scheme)g(correspondence)332
9007 y Ft(The)54 b(following)f(table)g(lists)h(the)f(Scheme)g(pr)m
(ocedur)m(es)g(that)h(corr)m(espond)f(to)h(particular)f(C)g(pr)m(o-)332
9233 y(cedur)m(es.)j(Not)46 b(all)f(of)h(the)f(Scheme)h(pr)m(ocedur)m
(es)e(listed)i(ar)m(e)f(part)h(of)f(the)h(POSIX)g(interface.)616
9641 y(C)f(pr)m(ocedur)m(e)913 b(Scheme)45 b(pr)m(ocedur)m(e\(s\))616
9867 y Fp(access)1255 b(accessible?)616 10093 y(chdir)1364
b(set-working-directory!)616 10319 y(close)g(close-input-port,)111
b(close-output-port,)2743 10545 y(close-channel,)g(close-socket)616
10771 y(closedir)1037 b(close-directory-stream)616 10996
y(creat)1364 b(open-file)616 11222 y(ctime)g(time->string)616
11448 y(dup)1582 b(dup,)109 b(dup-switching-mode)616
11674 y(dup2)1473 b(dup2)3616 12141 y Ft(100)p eop end
%%Page: 101 109
TeXDict begin 101 108 bop 450 1146 a Ft(C)45 b(pr)m(ocedur)m(e)913
b(Scheme)45 b(pr)m(ocedur)m(e\(s\))450 1372 y Fp(exec[l|v][e|p|)p
Fh(\017)p Fp(])200 b(exec,)109 b(exec-with-environment,)2577
1597 y(exec-file,)h(exec-file-with-environment,)2577
1823 y(exec-with-alias)p 460 2049 55 7 v 515 2049 a(exit)1408
b(exit)450 2275 y(fcntl)1364 b(io-flags,)110 b(set-io-flags!,)2577
2501 y(close-on-exec,)g(set-close-on-exec!)450 2726 y(fork)1473
b(fork,)109 b(fork-and-forget)450 2952 y(fstat)1364 b(get-port-info)450
3178 y(getcwd)1255 b(working-directory)450 3404 y(getegid)1146
b(get-effective-group-id)450 3630 y(getenv)1255 b
(lookup-environment-variable,)2577 3856 y(environment-alist)450
4081 y(geteuid)1146 b(get-effective-user-id)450 4307
y(getgid)1255 b(get-group-id)450 4533 y(getgroups)928
b(get-groups)450 4759 y(getlogin)1037 b(get-login-name)450
4985 y(getpid)1255 b(get-process-id)450 5210 y(getppid)1146
b(get-parent-process-id)450 5436 y(getuid)1255 b(get-user-id)450
5662 y(isatty)g(port-is-a-terminal?)450 5888 y(link)1473
b(link)450 6114 y(lstat)1364 b(get-file/link-info)450
6340 y(mkdir)g(make-directory)450 6565 y(mkfifo)1255
b(make-fifo)450 6791 y(open)1473 b(open-file)450 7017
y(opendir)1146 b(open-directory-stream)450 7243 y(pipe)1473
b(open-pipe)450 7469 y(read)g(read-char,)110 b(read-block)450
7694 y(readdir)1146 b(read-directory-stream)450 7920
y(rename)1255 b(rename)450 8146 y(rmdir)1364 b(remove-directory)450
8372 y(setgid)1255 b(set-group-id!)450 8598 y(setuid)g(set-user-id!)450
8824 y(stat)1473 b(get-file-info)450 9049 y(time)g(current-time)450
9275 y(ttyname)1146 b(port-terminal-name)450 9501 y(umask)1364
b(set-file-creation-mask!)450 9727 y(uname)g(os-name,)110
b(os-node-name,)2577 9953 y(os-release-name,)h(os-version-name,)2577
10178 y(machine-name)450 10404 y(unlink)1255 b(unlink)450
10630 y(waitpid)1146 b(wait-for-child-process)450 10856
y(write)1364 b(write-char,)110 b(write-block)3450 12141
y Ft(101)p eop end
%%Page: 102 110
TeXDict begin 102 109 bop 332 2391 a Fo(Appendix)88 b(A)332
3221 y Fr(ASCII)104 b(character)e(encoding)332 4144 y
Ft(\223ASCII\224)80 b(stands)e(for)g(\223American)g(Standar)m(d)g(Code)
h(for)f(Information)g(Inter)m(change\224.)155 b(The)332
4370 y(ASCII)60 b(standar)m(d)e(is)h(a)f(seven-bit)g(code)g(published)g
(by)g(the)h(United)g(States)h(of)e(America)g(Stan-)332
4596 y(dar)m(ds)42 b(Institute)h(\(USASI\))h(in)e(1968.)55
b(The)43 b(ASCII)h(encoding)e(forms)g(the)g(\002rst)h(half)f(of)g
(ISO-8859-1)332 4822 y(\(Latin1\))j(which)f(in)h(turn)g(forms)g(the)g
(\002rst)h(page)g(of)f(ISO)h(10646)f(\(Unicode\).)614
5048 y(The)67 b(Scheme)f(48)f(pr)m(ocedur)m(es)h Fp(char->ascii)h
Ft(and)f Fp(ascii->char)h Ft(\(section)e(5.3\))h(give)332
5273 y(access)45 b(to)h(the)g(ASCII)h(encoding.)444 5663
y Fc(n)541 5688 y Fb(10)880 5663 y Fc(n)977 5688 y Fb(16)2037
5663 y Fc(Unicode)41 b(name)1079 b(n)4281 5688 y Fb(10)4620
5663 y Fc(n)4717 5688 y Fb(16)5587 5663 y Fc(Unicode)41
b(name)581 5863 y Fa(0)337 b(0)199 b Fc(NUL)352 b(null)1892
b Fa(64)236 b(40)199 b(@)430 b Fc(commer)m(cial)40 b(at)581
6062 y Fa(1)337 b(1)199 b Fc(SOH)364 b(start)41 b(of)h(heading)1031
b Fa(65)236 b(41)199 b(A)430 b Fc(latin)42 b(capital)g(letter)f(a)581
6261 y Fa(2)337 b(2)199 b Fc(STX)420 b(start)41 b(of)h(text)1355
b Fa(66)236 b(42)199 b(B)430 b Fc(latin)42 b(capital)g(letter)f(b)581
6460 y Fa(3)337 b(3)199 b Fc(ETX)406 b(end)41 b(of)g(text)1405
b Fa(67)236 b(43)199 b(C)430 b Fc(latin)42 b(capital)g(letter)f(c)581
6660 y Fa(4)337 b(4)199 b Fc(EOT)386 b(end)41 b(of)g(transmission)738
b Fa(68)236 b(44)199 b(D)430 b Fc(latin)42 b(capital)g(letter)f(d)581
6859 y Fa(5)337 b(5)199 b Fc(ENQ)350 b(enquiry)1609 b
Fa(69)236 b(45)199 b(E)430 b Fc(latin)42 b(capital)g(letter)f(e)581
7058 y Fa(6)337 b(6)199 b Fc(ACK)352 b(acknowledge)1209
b Fa(70)236 b(46)199 b(F)430 b Fc(latin)42 b(capital)g(letter)f(f)581
7257 y Fa(7)337 b(7)199 b Fc(BEL)417 b(bell)1917 b Fa(71)236
b(47)199 b(G)430 b Fc(latin)42 b(capital)g(letter)f(g)581
7457 y Fa(8)337 b(8)199 b Fc(BS)532 b(backspace)1437
b Fa(72)236 b(48)199 b(H)430 b Fc(latin)42 b(capital)g(letter)f(h)581
7656 y Fa(9)337 b(9)199 b Fc(HT)480 b(horizontal)40 b(tabulation)637
b Fa(73)236 b(49)199 b(I)430 b Fc(latin)42 b(capital)g(letter)f(i)482
7855 y Fa(10)336 b(A)199 b Fc(LF)527 b(line)41 b(feed)1555
b Fa(74)236 b(4A)199 b(J)430 b Fc(latin)42 b(capital)g(letter)f(j)482
8055 y Fa(11)336 b(B)199 b Fc(VT)498 b(vertical)41 b(tabulation)847
b Fa(75)236 b(4B)199 b(K)430 b Fc(latin)42 b(capital)g(letter)f(k)482
8254 y Fa(12)336 b(C)199 b Fc(FF)536 b(form)40 b(feed)1470
b Fa(76)236 b(4C)199 b(L)430 b Fc(latin)42 b(capital)g(letter)f(l)482
8453 y Fa(13)336 b(D)199 b Fc(CR)491 b(carriage)40 b(r)m(eturn)1093
b Fa(77)236 b(4D)199 b(M)430 b Fc(latin)42 b(capital)g(letter)f(m)482
8652 y Fa(14)336 b(E)199 b Fc(SO)502 b(shift)42 b(out)1574
b Fa(78)236 b(4E)199 b(N)430 b Fc(latin)42 b(capital)g(letter)f(n)482
8852 y Fa(15)336 b(F)199 b Fc(SI)577 b(shift)42 b(in)1674
b Fa(79)236 b(4F)199 b(O)430 b Fc(latin)42 b(capital)g(letter)f(o)482
9051 y Fa(16)236 b(10)199 b Fc(DLE)389 b(data)42 b(link)g(escape)1008
b Fa(80)236 b(50)199 b(P)430 b Fc(latin)42 b(capital)g(letter)f(p)482
9250 y Fa(17)236 b(11)199 b Fc(DC1)390 b(device)41 b(contr)m(ol)f(one)
841 b Fa(81)236 b(51)199 b(Q)430 b Fc(latin)42 b(capital)g(letter)f(q)
482 9449 y Fa(18)236 b(12)199 b Fc(DC2)390 b(device)41
b(contr)m(ol)f(two)826 b Fa(82)236 b(52)199 b(R)430 b
Fc(latin)42 b(capital)g(letter)f(r)482 9649 y Fa(19)236
b(13)199 b Fc(DC3)390 b(device)41 b(contr)m(ol)f(thr)m(ee)735
b Fa(83)236 b(53)199 b(S)430 b Fc(latin)42 b(capital)g(letter)f(s)482
9848 y Fa(20)236 b(14)199 b Fc(DC4)390 b(device)41 b(contr)m(ol)f(four)
797 b Fa(84)236 b(54)199 b(T)430 b Fc(latin)42 b(capital)g(letter)f(t)
482 10047 y Fa(21)236 b(15)199 b Fc(NAK)332 b(negative)40
b(acknowledge)541 b Fa(85)236 b(55)199 b(U)430 b Fc(latin)42
b(capital)g(letter)f(u)482 10246 y Fa(22)236 b(16)199
b Fc(SYN)384 b(synchr)m(onous)40 b(idle)926 b Fa(86)236
b(56)199 b(V)430 b Fc(latin)42 b(capital)g(letter)f(v)482
10446 y Fa(23)236 b(17)199 b Fc(ETB)416 b(end)41 b(of)g(transmission)h
(block)299 b Fa(87)236 b(57)199 b(W)430 b Fc(latin)42
b(capital)g(letter)f(w)482 10645 y Fa(24)236 b(18)199
b Fc(CAN)335 b(cancel)1729 b Fa(88)236 b(58)199 b(X)430
b Fc(latin)42 b(capital)g(letter)f(x)482 10844 y Fa(25)236
b(19)199 b Fc(EM)462 b(end)41 b(of)g(medium)1056 b Fa(89)236
b(59)199 b(Y)430 b Fc(latin)42 b(capital)g(letter)f(y)482
11043 y Fa(26)236 b(1A)199 b Fc(SUB)403 b(substitute)1463
b Fa(90)236 b(5A)199 b(Z)430 b Fc(latin)42 b(capital)g(letter)f(z)482
11243 y Fa(27)236 b(1B)199 b Fc(ESC)414 b(escape)1698
b Fa(91)236 b(5B)199 b([)430 b Fc(left)42 b(squar)m(e)f(bracket)482
11442 y Fa(28)236 b(1C)199 b Fc(FS)541 b(\002le)41 b(separator)1223
b Fa(92)236 b(5C)199 b(\\)430 b Fc(r)m(everse)40 b(solidus)482
11641 y Fa(29)236 b(1D)199 b Fc(GS)506 b(gr)m(oup)41
b(separator)1005 b Fa(93)236 b(5D)199 b(])430 b Fc(right)42
b(squar)m(e)f(bracket)3616 12141 y Ft(102)p eop end
%%Page: 103 111
TeXDict begin 103 110 bop 278 1146 a Fc(n)375 1171 y
Fb(10)714 1146 y Fc(n)811 1171 y Fb(16)1871 1146 y Fc(Unicode)41
b(name)1078 b(n)4114 1171 y Fb(10)4454 1146 y Fc(n)4551
1171 y Fb(16)5421 1146 y Fc(Unicode)41 b(name)316 1345
y Fa(30)236 b(1E)199 b Fc(RS)522 b(r)m(ecor)m(d)40 b(separator)980
b Fa(94)236 b(5E)199 b(\210)430 b Fc(cir)m(cum\003ex)40
b(accent)316 1544 y Fa(31)236 b(1F)199 b Fc(US)504 b(unit)41
b(separator)1152 b Fa(95)236 b(5F)199 b(_)430 b Fc(low)42
b(line)316 1743 y Fa(32)236 b(20)199 b Fc(SP)-15 b(ACE)200
b(space)1778 b Fa(96)236 b(60)199 b(`)430 b Fc(grave)41
b(accent)316 1943 y Fa(33)236 b(21)199 b(!)620 b Fc(exclamation)40
b(mark)866 b Fa(97)236 b(61)199 b(a)430 b Fc(latin)42
b(small)g(letter)f(a)316 2142 y Fa(34)236 b(22)199 b(")620
b Fc(quotation)41 b(mark)1045 b Fa(98)236 b(62)199 b(b)430
b Fc(latin)42 b(small)g(letter)f(b)316 2341 y Fa(35)236
b(23)199 b(#)620 b Fc(number)39 b(sign)1257 b Fa(99)236
b(63)199 b(c)430 b Fc(latin)42 b(small)g(letter)f(c)316
2540 y Fa(36)236 b(24)199 b($)620 b Fc(dollar)41 b(sign)1300
b Fa(100)236 b(64)199 b(d)430 b Fc(latin)42 b(small)g(letter)f(d)316
2740 y Fa(37)236 b(25)199 b(\045)620 b Fc(per)m(cent)39
b(sign)1191 b Fa(101)236 b(65)199 b(e)430 b Fc(latin)42
b(small)g(letter)f(e)316 2939 y Fa(38)236 b(26)199 b(&)620
b Fc(ampersand)1258 b Fa(102)236 b(66)199 b(f)430 b Fc(latin)42
b(small)g(letter)f(f)316 3138 y Fa(39)236 b(27)199 b(')620
b Fc(apostr)m(ophe)1256 b Fa(103)236 b(67)199 b(g)430
b Fc(latin)42 b(small)g(letter)f(g)316 3337 y Fa(40)236
b(28)199 b(\()620 b Fc(left)41 b(par)m(enthesis)965 b
Fa(104)236 b(68)199 b(h)430 b Fc(latin)42 b(small)g(letter)f(h)316
3537 y Fa(41)236 b(29)199 b(\))620 b Fc(right)41 b(par)m(enthesis)845
b Fa(105)236 b(69)199 b(i)430 b Fc(latin)42 b(small)g(letter)f(i)316
3736 y Fa(42)236 b(2A)199 b(*)620 b Fc(asterisk)1522
b Fa(106)236 b(6A)199 b(j)430 b Fc(latin)42 b(small)g(letter)f(j)316
3935 y Fa(43)236 b(2B)199 b(+)620 b Fc(plus)42 b(sign)1418
b Fa(107)236 b(6B)199 b(k)430 b Fc(latin)42 b(small)g(letter)f(k)316
4134 y Fa(44)236 b(2C)199 b(,)620 b Fc(comma)1543 b Fa(108)236
b(6C)199 b(l)430 b Fc(latin)42 b(small)g(letter)f(l)316
4334 y Fa(45)236 b(2D)199 b(-)620 b Fc(hyphen-minus)1005
b Fa(109)236 b(6D)199 b(m)430 b Fc(latin)42 b(small)g(letter)f(m)316
4533 y Fa(46)236 b(2E)199 b(.)620 b Fc(full)42 b(stop)1477
b Fa(110)236 b(6E)199 b(n)430 b Fc(latin)42 b(small)g(letter)f(n)316
4732 y Fa(47)236 b(2F)199 b(/)620 b Fc(solidus)1557 b
Fa(111)236 b(6F)199 b(o)430 b Fc(latin)42 b(small)g(letter)f(o)316
4932 y Fa(48)236 b(30)199 b(0)620 b Fc(digit)43 b(zer)m(o)1382
b Fa(112)236 b(70)199 b(p)430 b Fc(latin)42 b(small)g(letter)f(p)316
5131 y Fa(49)236 b(31)199 b(1)620 b Fc(digit)43 b(one)1431
b Fa(113)236 b(71)199 b(q)430 b Fc(latin)42 b(small)g(letter)f(q)316
5330 y Fa(50)236 b(32)199 b(2)620 b Fc(digit)43 b(two)1416
b Fa(114)236 b(72)199 b(r)430 b Fc(latin)42 b(small)g(letter)f(r)316
5529 y Fa(51)236 b(33)199 b(3)620 b Fc(digit)43 b(thr)m(ee)1325
b Fa(115)236 b(73)199 b(s)430 b Fc(latin)42 b(small)g(letter)f(s)316
5729 y Fa(52)236 b(34)199 b(4)620 b Fc(digit)43 b(four)1387
b Fa(116)236 b(74)199 b(t)430 b Fc(latin)42 b(small)g(letter)f(t)316
5928 y Fa(53)236 b(35)199 b(5)620 b Fc(digit)43 b(\002ve)1425
b Fa(117)236 b(75)199 b(u)430 b Fc(latin)42 b(small)g(letter)f(u)316
6127 y Fa(54)236 b(36)199 b(6)620 b Fc(digit)43 b(six)1495
b Fa(118)236 b(76)199 b(v)430 b Fc(latin)42 b(small)g(letter)f(v)316
6326 y Fa(55)236 b(37)199 b(7)620 b Fc(digit)43 b(seven)1278
b Fa(119)236 b(77)199 b(w)430 b Fc(latin)42 b(small)g(letter)f(w)316
6526 y Fa(56)236 b(38)199 b(8)620 b Fc(digit)43 b(eight)1328
b Fa(120)236 b(78)199 b(x)430 b Fc(latin)42 b(small)g(letter)f(x)316
6725 y Fa(57)236 b(39)199 b(9)620 b Fc(digit)43 b(nine)1377
b Fa(121)236 b(79)199 b(y)430 b Fc(latin)42 b(small)g(letter)f(y)316
6924 y Fa(58)236 b(3A)199 b(:)620 b Fc(colon)1684 b Fa(122)236
b(7A)199 b(z)430 b Fc(latin)42 b(small)g(letter)f(z)316
7123 y Fa(59)236 b(3B)199 b(;)620 b Fc(semicolon)1339
b Fa(123)236 b(7B)199 b({)430 b Fc(left)42 b(curly)g(bracket)316
7323 y Fa(60)236 b(3C)199 b(<)620 b Fc(less-than)41 b(sign)1083
b Fa(124)236 b(7C)199 b(|)430 b Fc(vertical)41 b(line)316
7522 y Fa(61)236 b(3D)199 b(=)620 b Fc(equals)41 b(sign)1263
b Fa(125)236 b(7D)199 b(})430 b Fc(right)42 b(curly)f(bracket)316
7721 y Fa(62)236 b(3E)199 b(>)620 b Fc(gr)m(eater)m(-than)40
b(sign)837 b Fa(126)236 b(7E)199 b(\230)430 b Fc(tilde)316
7920 y Fa(63)236 b(3F)199 b(?)620 b Fc(question)41 b(mark)1023
b Fa(127)236 b(7F)199 b Fc(DEL)g(delete)3450 12141 y
Ft(103)p eop end
%%Page: 104 112
TeXDict begin 104 111 bop 332 2474 a Fr(Bibliography)423
3397 y Ft([1])90 b(Information)37 b(technology)g(\226)h(Portable)f
(Operating)g(System)h(Interface)f(\(POSIX\).)48 b(ISO/IEC)726
3623 y(9945-1)c(ANSI/IEEE)k(Std)e(1003.1.)66 b(2nd)45
b(Ed.,)i(1996.)423 3998 y([2])90 b(W)-10 b(illiam)44
b(Clinger)h(and)g(Jonathan)g(Rees.)67 b(Macr)m(os)45
b(that)g(work.)66 b Fs(Principles)43 b(of)i(Pr)m(ogramming)726
4224 y(Languages)p Ft(,)g(January)f(1991.)423 4599 y([3])90
b(W)-10 b(illiam)45 b(Clinger)h(and)h(Jonathan)f(Rees)h(\(editors\).)69
b(Revised)5026 4533 y Fn(4)5152 4599 y Ft(r)m(eport)47
b(on)f(the)h(algorithmic)726 4825 y(language)e(Scheme.)65
b Fs(LISP)46 b(Pointers)d Ft(IV\(3\):1\22655,)j(July-September)e(1991.)
423 5200 y([4])90 b(Pavel)41 b(Curtis)g(and)g(James)f(Rauen.)57
b(A)42 b(module)f(system)g(for)g(Scheme.)57 b Fs(ACM)42
b(Confer)m(ence)d(on)726 5426 y(Lisp)45 b(and)g(Functional)f(Pr)m
(ogramming,)h Ft(pages)h(13\22619,)f(1990.)423 5801 y([5])90
b(Richar)m(d)39 b(Kelsey)h(and)f(Jonathan)g(Rees.)54
b(A)40 b(T)-16 b(ractable)39 b(Scheme)g(Implementation.)53
b Fs(Lisp)39 b(and)726 6027 y(Symbolic)45 b(Computation)f
Ft(7:315\226335)h(1994.)423 6403 y([6])90 b(Richar)m(d)66
b(Kelsey)-20 b(,)73 b(W)-10 b(ill)67 b(Clinger)-13 b(,)72
b(Jonathan)67 b(Rees)g(\(editors\).)135 b(Revised)5886
6337 y Fn(5)6032 6403 y Ft(Report)69 b(on)e(the)726 6628
y(Algorithmic)55 b(Language)h(Scheme.)98 b Fs(Higher-Order)54
b(and)h(Symbolic)g(Computation,)i Ft(V)-20 b(ol.)57 b(11,)726
6854 y(No.)42 b(1,)h(September)-13 b(,)42 b(1998.)57
b(and)42 b Fs(ACM)f(SIGPLAN)i(Notices)p Ft(,)e(V)-20
b(ol.)42 b(33,)h(No.)f(9,)h(October)-13 b(,)42 b(1998.)423
7229 y([7])90 b(David)48 b(MacQueen.)74 b(Modules)49
b(for)f(Standar)m(d)g(ML.)76 b Fs(ACM)48 b(Confer)m(ence)f(on)h(Lisp)g
(and)g(Func-)726 7455 y(tional)c(Pr)m(ogramming,)h Ft(1984.)423
7831 y([8])90 b(Jonathan)36 b(Rees)i(and)f(Br)o(uce)f(Donald.)48
b(Pr)m(ogram)36 b(mobile)h(r)m(obots)g(in)g(Scheme.)47
b Fs(International)726 8056 y(Confer)m(ence)d(on)h(Robotics)f(and)h
(Automation,)g Ft(IEEE,)h(1992.)423 8432 y([9])90 b(Mark)68
b(A.)i(Sheldon)e(and)h(David)e(K.)i(Gif)m(for)m(d.)138
b(Static)69 b(dependent)g(types)h(for)e(\002rst-class)726
8657 y(modules.)61 b Fs(ACM)44 b(Confer)m(ence)e(on)h(Lisp)g(and)h
(Functional)e(Pr)m(ogramming,)h Ft(pages)h(20\22629,)g(1990.)332
9033 y([10])90 b(Olin)44 b(Shivers,)g(Brian)g(D.)g(Carlstr)m(om,)g
(Martin)g(Gasbichler)f(and)h(Mike)g(Sperber)-13 b(.)62
b(Scsh)44 b(Ref-)726 9259 y(er)m(ence)h(Manual,)g(scsh)g(r)m(elease)g
(0.6.6.)67 b(A)-17 b(vailable)45 b(at)g(URL)i Fp(http://www.scsh.net/)p
Ft(.)332 9634 y([11])90 b(Olin)57 b(Shivers.)105 b(A)58
b(universal)e(scripting)h(framework,)j(or)e(Lambda:)80
b(the)58 b(ultimate)f(\223little)726 9860 y(language\224.)131
b Fs(Concurr)m(ency)65 b(and)h(Parallelism,)j(Pr)m(ogramming,)i
(Networking,)f(and)c(Security)-7 b(,)726 10085 y Ft(pages)46
b(254\226265,)f(Springer)h(1996.)65 b(Joxan)45 b(Jaf)m(far)f(and)h
(Roland)h(H.)g(C.)g(Y)-17 b(ap,)46 b(editors.)3616 12141
y(104)p eop end
%%Page: 105 113
TeXDict begin 105 112 bop 166 2090 a Fr(Index)166 2944
y Ft(The)59 b(principal)f(entry)h(for)f(each)g(term,)63
b(pr)m(oce-)166 3170 y(dur)m(e,)52 b(or)e(keywor)m(d)h(is)f(listed)h
(\002rst,)h(separated)166 3396 y(fr)m(om)44 b(the)i(other)g(entries)f
(by)g(a)h(semicolon.)166 4019 y Fp(accessible?)137 b
Ft(95)166 4245 y Fp(add-signal-queue-signal!)i Ft(91)166
4472 y Fp(any)e Ft(29)166 4699 y Fp(any-match?)g Ft(62)166
4926 y Fp(any?)g Ft(29)166 5153 y Fp(arithmetic-shift)h
Ft(31)166 5380 y Fp(array)f Ft(33)166 5606 y Fp(array->vector)h
Ft(33)166 5833 y Fp(array-dimensions)g Ft(33)166 6060
y Fp(array-ref)f Ft(33)166 6287 y Fp(array-set!)g Ft(33)166
6514 y Fp(array?)g Ft(33)166 6741 y Fp(ascii->char)g
Ft(31)166 6967 y Fp(ascii-limit)g Ft(31)166 7194 y Fp(ascii-range)g
Ft(60)166 7421 y Fp(ascii-ranges)g Ft(60)166 7648 y Fp
(ascii-whitespaces)h Ft(31)166 7875 y Fp(atom?)f Ft(29)166
8102 y Fp(atomically!)g Ft(69)166 8511 y Fp(bit-count)g
Ft(31)166 8738 y Fp(bitwise-and)g Ft(31)166 8965 y Fp(bitwise-ior)g
Ft(31)166 9192 y Fp(bitwise-not)g Ft(31)166 9419 y Fp(bitwise-xor)g
Ft(31)166 9645 y Fp(byte-vector)g Ft(31)166 9872 y Fp
(byte-vector-length)h Ft(31)166 10099 y Fp(byte-vector-ref)g
Ft(31)166 10326 y Fp(byte-vector-set!)g Ft(31)166 10553
y Fp(byte-vector?)f Ft(31)166 10963 y Fp(call-atomically)h
Ft(69)166 11189 y Fp(call-atomically!)g Ft(69)166 11416
y Fp(call-ensuring-atomicity)g Ft(68)166 11643 y Fp
(call-ensuring-atomicity!)h Ft(68)3669 2944 y Fp(call-external)f
Ft(78;)45 b(77)3669 3173 y Fp(call-external-value)138
b Ft(77)3669 3403 y Fp(call-imported-binding)g Ft(77)3669
3632 y Fp(cell-ref)f Ft(32)3669 3861 y Fp(cell-set!)g
Ft(32)3669 4090 y Fp(cell?)g Ft(32)3669 4319 y Fp(char->ascii)g
Ft(31)3669 4548 y Fp(close-all-but)h Ft(99)3669 4777
y Fp(close-directory-stream)g Ft(94)3669 5006 y Fp(close-on-exec?)g
Ft(99)3669 5236 y Fp(close-socket)g Ft(43)3669 5465 y
Fp(compound-interface)g Ft(21)3669 5694 y Fp(concatenate-symbol)g
Ft(30)3669 5923 y Fp(condvar-has-value?)g Ft(70)3669
6152 y Fp(condvar-value)g Ft(70)3669 6381 y Fp(condvar?)f
Ft(70)3669 6610 y Fp(copy-array)g Ft(33)3669 6839 y Fp(current-column)h
Ft(41)3669 7069 y Fp(current-proposal)g Ft(70)3669 7298
y Fp(current-row)f Ft(41)3669 7527 y Fp(current-thread)h
Ft(66)3669 7756 y Fp(current-time)g Ft(98)3669 8206 y
Fp(debug-message)g Ft(67)3669 8435 y Fp(default-hash-function)g
Ft(40)3669 8664 y Fp(define-exported-binding)h Ft(75)3669
8894 y Fp(define-imported-binding)g Ft(76)3669 9123 y
Fp(define-interface)f Ft(20)3669 9352 y Fp(define-record-discloser)h
Ft(36;)45 b(35)3669 9581 y Fp(define-record-resumer)138
b Ft(83;)46 b(36)3669 9810 y Fp(define-structure)138
b Ft(18)3669 10039 y Fp(delete)f Ft(30)3669 10268 y Fp
(delete-from-queue!)h Ft(32)3669 10497 y Fp(delq)f Ft(30)3669
10727 y Fp(delq!)g Ft(30)3669 10956 y Fp(dequeue!)g Ft(32)3669
11185 y Fp(dequeue-signal!)h Ft(91)3669 11414 y Fp(directory-stream?)g
Ft(93)3669 11643 y Fp(dup)f Ft(99)3450 12141 y(105)p
eop end
%%Page: 106 114
TeXDict begin 106 113 bop 332 1146 a Fp(dup-switching-mode)138
b Ft(99)332 1372 y Fp(dup2)f Ft(99)332 1597 y Fp(dynamic-load)h
Ft(78)332 1990 y Fp(enqueue!)f Ft(32)332 2216 y Fp(ensure-atomicity!)h
Ft(68)332 2442 y Fp(enum-set->list)g Ft(39)332 2668 y
Fp(enum-set-intersection)g Ft(39)332 2894 y Fp(enum-set-member?)g
Ft(39)332 3119 y Fp(enum-set-negation)g Ft(39)332 3345
y Fp(enum-set-union)g Ft(39)332 3571 y Fp(enum-set=?)f
Ft(39)332 3797 y Fp(environment-alist)h Ft(92)332 4023
y Fp(every?)f Ft(29)332 4249 y Fp(exact-match?)h Ft(62)332
4475 y Fp(exec)f Ft(88)332 4700 y Fp(exec-file)g Ft(88)332
4926 y Fp(exec-file-with-environment)i Ft(88)332 5152
y Fp(exec-with-alias)f Ft(88)332 5378 y Fp(exec-with-environment)g
Ft(88)332 5604 y Fp(exit)f Ft(88)332 5830 y Fp(external-name)h
Ft(78)332 6056 y Fp(external-value)g Ft(78)332 6281 y
Fp(external?)f Ft(78)332 6674 y Fp(fd-port?)g Ft(98)332
6900 y Fp(file-info-device)h Ft(96)332 7126 y Fp(file-info-group)g
Ft(96)332 7352 y Fp(file-info-inode)g Ft(96)332 7578
y Fp(file-info-last-access)g Ft(96)332 7803 y Fp
(file-info-last-info-change)h Ft(96)332 8029 y Fp
(file-info-last-modification)g Ft(96)332 8255 y Fp
(file-info-link-count)f Ft(96)332 8481 y Fp(file-info-mode)g
Ft(96)332 8707 y Fp(file-info-name)g Ft(96)332 8933 y
Fp(file-info-owner)g Ft(96)332 9159 y Fp(file-info-size)g
Ft(96)332 9384 y Fp(file-info-type)g Ft(96)332 9610 y
Fp(file-info?)f Ft(96)332 9836 y Fp(file-mode+)g Ft(97)332
10062 y Fp(file-mode-)g Ft(97)332 10288 y Fp(file-mode->integer)h
Ft(97)332 10514 y Fp(file-mode<=?)g Ft(97)332 10740 y
Fp(file-mode=?)f Ft(97)332 10965 y Fp(file-mode>=?)h
Ft(97)332 11191 y Fp(file-mode?)f Ft(97)332 11417 y Fp
(file-options-on?)h Ft(94)332 11643 y Fp(file-type-name)g
Ft(96)3835 1146 y Fp(file-type?)f Ft(96)3835 1372 y Fp(filter)g
Ft(30)3835 1597 y Fp(filter!)g Ft(30)3835 1823 y Fp(filter-map)g
Ft(30)3835 2049 y Fp(first)g Ft(29)3835 2275 y Fp(fluid)g
Ft(41)3835 2501 y Fp(fork)g Ft(87)3835 2726 y Fp(fork-and-forget)h
Ft(87)3835 2952 y Fp(fresh-line)f Ft(41)3835 3336 y Fp
(get-effective-group-id)h Ft(92)3835 3561 y Fp(get-effective-user-id)g
Ft(92)3835 3787 y Fp(get-external)g Ft(78)3835 4013 y
Fp(get-file-info)g Ft(96)3835 4239 y Fp(get-file/link-info)g
Ft(96)3835 4465 y Fp(get-group-id)g Ft(92)3835 4690 y
Fp(get-groups)f Ft(92)3835 4916 y Fp(get-host-name)h
Ft(43)3835 5142 y Fp(get-login-name)g Ft(92)3835 5368
y Fp(get-parent-process-id)g Ft(92)3835 5594 y Fp(get-port-info)g
Ft(96)3835 5820 y Fp(get-process-id)g Ft(92)3835 6045
y Fp(get-user-id)f Ft(92)3835 6271 y Fp(group-id->group-info)h
Ft(93)3835 6497 y Fp(group-id->integer)g Ft(92)3835 6723
y Fp(group-id=?)f Ft(92)3835 6949 y Fp(group-id?)g Ft(92)3835
7174 y Fp(group-info-id)h Ft(93)3835 7400 y Fp(group-info-members)g
Ft(93)3835 7626 y Fp(group-info-name)g Ft(93)3835 7852
y Fp(group-info?)f Ft(93)3835 8235 y Fp(have-system?)h
Ft(42)3835 8618 y Fp(i/o-flags)f Ft(99)3835 8844 y Fp(identity)g
Ft(29)3835 9070 y Fp(ignore-case)g Ft(61)3835 9296 y
Fp(import-definition)h Ft(76)3835 9522 y Fp(import-lambda-definition)h
Ft(77)3835 9747 y Fp(integer->file-mode)f Ft(97)3835
9973 y Fp(integer->group-id)g Ft(92)3835 10199 y Fp
(integer->process-id)g Ft(88)3835 10425 y Fp(integer->signal)g
Ft(89)3835 10651 y Fp(integer->user-id)g Ft(92)3835 10877
y Fp(intersection)g Ft(60)3835 11260 y Fp(kill-thread!)g
Ft(67)3835 11643 y Fp(let-fluid)f Ft(41)3616 12141 y(106)p
eop end
%%Page: 107 115
TeXDict begin 107 114 bop 166 1146 a Fp(let-fluids)137
b Ft(41)166 1374 y Fp(limit-output)g Ft(41)166 1603 y
Fp(link)g Ft(95)166 1831 y Fp(list->queue)g Ft(32)166
2060 y Fp(list-delete-neighbor-dups)i Ft(57;)45 b(53)166
2289 y Fp(list-delete-neighbor-dups!)139 b Ft(57)166
2517 y Fp(list-directory)f Ft(94)166 2746 y Fp(list-merge)f
Ft(56;)46 b(53)166 2974 y Fp(list-merge!)137 b Ft(56;)46
b(53)166 3203 y Fp(list-merge-sort)138 b Ft(56)166 3431
y Fp(list-merge-sort!)g Ft(56)166 3660 y Fp(list-sort)f
Ft(53)166 3889 y Fp(list-sort!)g Ft(53)166 4117 y Fp(list-sorted?)g
Ft(55;)46 b(53)166 4346 y Fp(list-stable-sort)138 b Ft(53)166
4574 y Fp(list-stable-sort!)g Ft(53)166 4803 y Fp(lock?)f
Ft(71)166 5031 y Fp(lookup-all-externals)h Ft(78)166
5260 y Fp(lookup-environment-variable)h Ft(92)166 5488
y Fp(lookup-exported-binding)f Ft(76)166 5717 y Fp(lookup-external)g
Ft(78)166 5946 y Fp(lookup-imported-binding)g Ft(75)166
6386 y Fp(machine-name)f Ft(93)166 6615 y Fp(make-array)g
Ft(33)166 6843 y Fp(make-byte-vector)h Ft(31)166 7072
y Fp(make-cell)f Ft(32)166 7300 y Fp(make-condvar)g Ft(70)166
7529 y Fp(make-directory)h Ft(95)166 7757 y Fp(make-fifo)f
Ft(95)166 7986 y Fp(make-fluid)g Ft(41)166 8215 y Fp
(make-integer-table)h Ft(40)166 8443 y Fp(make-lock)f
Ft(71)166 8672 y Fp(make-placeholder)h Ft(72)166 8900
y Fp(make-proposal)g Ft(70)166 9129 y Fp(make-queue)f
Ft(32)166 9357 y Fp(make-record)g Ft(35)166 9586 y Fp(make-record-type)
h Ft(36)166 9815 y Fp(make-regexp)f Ft(99)166 10043 y
Fp(make-shared-array)h Ft(33)166 10272 y Fp(make-signal-queue)g
Ft(91)166 10500 y Fp(make-sparse-vector)g Ft(32)166 10729
y Fp(make-string-input-port)g Ft(40)166 10957 y Fp
(make-string-output-port)g Ft(40)166 11186 y Fp(make-string-table)g
Ft(40)166 11414 y Fp(make-symbol-table)g Ft(39)166 11643
y Fp(make-table)f Ft(39)3669 1146 y Fp(make-table-immutable!)h
Ft(40)3669 1372 y Fp(make-table-maker)g Ft(40)3669 1599
y Fp(make-time)f Ft(98)3669 1825 y Fp(make-tracking-input-port)i
Ft(41)3669 2052 y Fp(make-tracking-output-port)g Ft(41)3669
2278 y Fp(match)e Ft(62)3669 2505 y Fp(match-end)g Ft(100;)46
b(62)3669 2731 y Fp(match-start)137 b Ft(100;)46 b(62)3669
2958 y Fp(match-submatches)138 b Ft(62)3669 3184 y Fp(match?)f
Ft(100)3669 3411 y Fp(maybe-commit)h Ft(70)3669 3637
y Fp(maybe-commit-and-block)g Ft(72)3669 3864 y Fp
(maybe-commit-and-block-on-queue)4333 4090 y Ft(72)3669
4316 y Fp(maybe-commit-and-make-ready)h Ft(72)3669 4543
y Fp(maybe-commit-and-set-condvar!)4333 4769 y Ft(70)3669
4995 y Fp(maybe-commit-and-wait-for-condvar)4333 5221
y Ft(70)3669 5447 y Fp(maybe-dequeue-signal!)f Ft(91)3669
5674 y Fp(maybe-dequeue-thread!)g Ft(72)3669 5900 y Fp
(maybe-obtain-lock)g Ft(71)3669 6127 y Fp(memq?)f Ft(29)3669
6353 y Fp(modify)g Ft(18)3669 6758 y Fp(n=)g Ft(29)3669
6984 y Fp(name->group-info)h Ft(93)3669 7211 y Fp(name->signal)g
Ft(89)3669 7437 y Fp(name->user-info)g Ft(93)3669 7664
y Fp(negate)f Ft(60)3669 7890 y Fp(neq?)g Ft(29)3669
8117 y Fp(no-op)g Ft(29)3669 8343 y Fp(no-submatches)h
Ft(62)3669 8570 y Fp(null-list?)f Ft(29)3669 8974 y Fp(obtain-lock)g
Ft(71)3669 9200 y Fp(one-of)g Ft(61)3669 9427 y Fp
(open-directory-stream)h Ft(93)3669 9653 y Fp(open-file)f
Ft(94)3669 9880 y Fp(open-pipe)g Ft(98)3669 10106 y Fp(open-socket)g
Ft(43)3669 10333 y Fp(os-name)g Ft(93)3669 10559 y Fp(os-node-name)h
Ft(93)3669 10786 y Fp(os-release-name)g Ft(93)3669 11012
y Fp(os-version-name)g Ft(93)3669 11417 y Fp(p)f Ft(30)3669
11643 y Fp(partition-list)h Ft(30)3450 12141 y(107)p
eop end
%%Page: 108 116
TeXDict begin 108 115 bop 332 1146 a Fp(partition-list!)138
b Ft(30)332 1372 y Fp(placeholder-set!)g Ft(72)332 1597
y Fp(placeholder-value)g Ft(72)332 1823 y Fp(placeholder?)g
Ft(72)332 2049 y Fp(port->fd)f Ft(98)332 2275 y Fp(port-is-a-terminal?)
h Ft(99)332 2501 y Fp(port-terminal-name)g Ft(99)332
2727 y Fp(prefix)f Ft(18)332 2953 y Fp(pretty-print)h
Ft(30)332 3178 y Fp(process-id->integer)g Ft(88)332 3404
y Fp(process-id-exit-status)g Ft(88)332 3630 y Fp
(process-id-terminating-signal)996 3856 y Ft(88)332 4082
y Fp(process-id=?)g Ft(88)332 4308 y Fp(process-id?)f
Ft(88)332 4534 y Fp(provisional-byte-vector-ref)i Ft(68)332
4759 y Fp(provisional-byte-vector-set!)996 4985 y Ft(68)332
5211 y Fp(provisional-car)f Ft(68)332 5437 y Fp(provisional-cdr)g
Ft(68)332 5663 y Fp(provisional-cell-ref)g Ft(68)332
5889 y Fp(provisional-cell-set!)g Ft(68)332 6115 y Fp
(provisional-set-car!)g Ft(68)332 6340 y Fp(provisional-set-cdr!)g
Ft(68)332 6566 y Fp(provisional-string-ref)g Ft(68)332
6792 y Fp(provisional-string-set!)h Ft(68)332 7018 y
Fp(provisional-vector-ref)f Ft(68)332 7244 y Fp
(provisional-vector-set!)h Ft(68)332 7637 y Fp(queue->list)e
Ft(32)332 7862 y Fp(queue-empty?)h Ft(32)332 8088 y Fp(queue-length)g
Ft(32)332 8314 y Fp(queue?)f Ft(32)332 8707 y Fp(range)g
Ft(60)332 8933 y Fp(ranges)g Ft(60)332 9159 y Fp(read-directory-stream)
h Ft(93)332 9384 y Fp(record)f Ft(35)332 9610 y Fp(record-accessor)h
Ft(36)332 9836 y Fp(record-constructor)g Ft(36)332 10062
y Fp(record-length)g Ft(35)332 10288 y Fp(record-modifier)g
Ft(36)332 10514 y Fp(record-predicate)g Ft(36)332 10740
y Fp(record-ref)f Ft(35)332 10965 y Fp(record-set!)g
Ft(35)332 11191 y Fp(record-type)g Ft(35)332 11417 y
Fp(record-type-field-names)i Ft(36)332 11643 y Fp(record-type-name)f
Ft(36)3835 1146 y Fp(record-type?)g Ft(36)3835 1374 y
Fp(record?)f Ft(35)3835 1603 y Fp(regexp-match)h Ft(100)3835
1832 y Fp(regexp?)f Ft(100)3835 2060 y Fp(release-lock)h
Ft(71)3835 2289 y Fp(relinquish-timeslice)g Ft(66)3835
2517 y Fp(remap-file-descriptors)g Ft(98)3835 2746 y
Fp(remove-directory)g Ft(95)3835 2975 y Fp(remove-duplicates)g
Ft(30)3835 3203 y Fp(remove-signal-queue-signal!)h Ft(91)3835
3432 y Fp(rename)e Ft(95)3835 3660 y Fp(repeat)g Ft(61)3835
3889 y Fp(reverse!)g Ft(30)3835 4330 y Fp(sequence)g
Ft(61)3835 4559 y Fp(set)g Ft(60)3835 4787 y Fp(set-close-on-exec?!)h
Ft(99)3835 5016 y Fp(set-condvar-has-value?!)h Ft(70)3835
5245 y Fp(set-condvar-value!)f Ft(70)3835 5473 y Fp
(set-current-proposal!)g Ft(70)3835 5702 y Fp(set-file-creation-mask!)h
Ft(95)3835 5931 y Fp(set-group-id!)f Ft(92)3835 6159
y Fp(set-i/o-flags!)g Ft(99)3835 6388 y Fp(set-user-id!)g
Ft(92)3835 6616 y Fp(set-working-directory!)g Ft(94)3835
6845 y Fp(shared-binding-is-import?)h Ft(76)3835 7074
y Fp(shared-binding-name)f Ft(76)3835 7302 y Fp(shared-binding-ref)g
Ft(75)3835 7531 y Fp(shared-binding-set!)g Ft(76)3835
7759 y Fp(shared-binding?)g Ft(76)3835 7988 y Fp(signal-name)f
Ft(89)3835 8217 y Fp(signal-os-number)h Ft(89)3835 8445
y Fp(signal-process)g Ft(91)3835 8674 y Fp
(signal-queue-monitored-signals)4499 8900 y Ft(91)3835
9128 y Fp(signal-queue?)g Ft(91)3835 9357 y Fp(signal=?)f
Ft(89)3835 9586 y Fp(signal?)g Ft(89)3835 9814 y Fp(sleep)g
Ft(66)3835 10043 y Fp(socket-accept)h Ft(43)3835 10271
y Fp(socket-client)g Ft(43)3835 10500 y Fp(socket-port-number)g
Ft(43)3835 10729 y Fp(sparse-vector->list)g Ft(32)3835
10957 y Fp(sparse-vector-ref)g Ft(32)3835 11186 y Fp
(sparse-vector-set!)g Ft(32)3835 11414 y Fp(spawn)f Ft(66)3835
11643 y Fp(string-end)g Ft(61)3616 12141 y(108)p eop
end
%%Page: 109 117
TeXDict begin 109 116 bop 166 1146 a Fp(string-hash)137
b Ft(40)166 1372 y Fp(string-output-port-output)i Ft(40)166
1599 y Fp(string-start)e Ft(61)166 1825 y Fp(submatch)g
Ft(62)166 2052 y Fp(subset)g Ft(18)166 2278 y Fp(subtract)g
Ft(60)166 2505 y Fp(system)g Ft(42)166 2909 y Fp(table-ref)g
Ft(40)166 3135 y Fp(table-set!)g Ft(40)166 3362 y Fp(table-walk)g
Ft(40)166 3588 y Fp(table?)g Ft(40)166 3815 y Fp
(terminate-current-thread)i Ft(66)166 4041 y Fp(terminate-thread!)f
Ft(67)166 4268 y Fp(text)f Ft(61)166 4494 y Fp(thread-name)g
Ft(66)166 4721 y Fp(thread-queue-empty?)h Ft(72)166 4947
y Fp(thread-uid)f Ft(66)166 5174 y Fp(thread?)g Ft(66)166
5400 y Fp(time->string)g Ft(98)166 5627 y Fp(time-seconds)g
Ft(98)166 5853 y Fp(time<=?)g Ft(98)166 6080 y Fp(time<?)g
Ft(98)166 6306 y Fp(time=?)g Ft(98)166 6533 y Fp(time>=?)g
Ft(98)166 6759 y Fp(time>?)g Ft(98)166 6986 y Fp(time?)g
Ft(98)166 7389 y Fp(undefine-exported-binding)i Ft(76)166
7616 y Fp(undefine-imported-binding)g Ft(76)166 7842
y Fp(union)e Ft(60)166 8069 y Fp(unlink)g Ft(95)166 8295
y Fp(use-case)g Ft(61)166 8522 y Fp(user-id->integer)h
Ft(92)166 8748 y Fp(user-id->user-info)g Ft(92)166 8975
y Fp(user-id=?)f Ft(92)166 9201 y Fp(user-id?)g Ft(92)166
9428 y Fp(user-info-group)h Ft(93)166 9654 y Fp
(user-info-home-directory)h Ft(93)166 9881 y Fp(user-info-id)e
Ft(93)166 10107 y Fp(user-info-name)h Ft(93)166 10334
y Fp(user-info-shell)g Ft(93)166 10560 y Fp(user-info?)f
Ft(93)166 10964 y Fp(vector-binary-search)h Ft(58)166
11191 y Fp(vector-binary-search3)g Ft(58)166 11417 y
Fp(vector-delete-neighbor-dups)h Ft(57;)830 11643 y(53)3669
1146 y Fp(vector-delete-neighbor-dups!)4333 1372 y Ft(57)3669
1597 y Fp(vector-heap-sort)f Ft(57)3669 1823 y Fp(vector-heap-sort!)g
Ft(57)3669 2049 y Fp(vector-insert-sort)g Ft(57)3669
2275 y Fp(vector-insert-sort!)g Ft(57)3669 2501 y Fp(vector-merge)g
Ft(56;)45 b(53)3669 2726 y Fp(vector-merge!)138 b Ft(56;)45
b(53)3669 2952 y Fp(vector-merge-sort)138 b Ft(56)3669
3178 y Fp(vector-merge-sort!)g Ft(56)3669 3404 y Fp(vector-sort)f
Ft(53)3669 3630 y Fp(vector-sort!)h Ft(53)3669 3856 y
Fp(vector-sorted?)g Ft(55;)45 b(53)3669 4081 y Fp(vector-stable-sort)
138 b Ft(53)3669 4307 y Fp(vector-stable-sort!)g Ft(53)3669
4699 y Fp(wait-for-child-process)g Ft(88)3669 4925 y
Fp(working-directory)g Ft(94)3450 12141 y(109)p eop end
%%Trailer

userdict /end-hook known{end-hook}if
%%EOF
